mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-18 08:12:26 +01:00
Enable nullable for LibraryManager (#11191)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1002, CS1591
|
||||
|
||||
using System;
|
||||
@@ -33,17 +31,17 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <summary>
|
||||
/// Occurs when [item added].
|
||||
/// </summary>
|
||||
event EventHandler<ItemChangeEventArgs> ItemAdded;
|
||||
event EventHandler<ItemChangeEventArgs>? ItemAdded;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [item updated].
|
||||
/// </summary>
|
||||
event EventHandler<ItemChangeEventArgs> ItemUpdated;
|
||||
event EventHandler<ItemChangeEventArgs>? ItemUpdated;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [item removed].
|
||||
/// </summary>
|
||||
event EventHandler<ItemChangeEventArgs> ItemRemoved;
|
||||
event EventHandler<ItemChangeEventArgs>? ItemRemoved;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the root folder.
|
||||
@@ -60,10 +58,10 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <param name="parent">The parent.</param>
|
||||
/// <param name="directoryService">An instance of <see cref="IDirectoryService"/>.</param>
|
||||
/// <returns>BaseItem.</returns>
|
||||
BaseItem ResolvePath(
|
||||
BaseItem? ResolvePath(
|
||||
FileSystemMetadata fileInfo,
|
||||
Folder parent = null,
|
||||
IDirectoryService directoryService = null);
|
||||
Folder? parent = null,
|
||||
IDirectoryService? directoryService = null);
|
||||
|
||||
/// <summary>
|
||||
/// Resolves a set of files into a list of BaseItem.
|
||||
@@ -86,7 +84,7 @@ namespace MediaBrowser.Controller.Library
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the person.</param>
|
||||
/// <returns>Task{Person}.</returns>
|
||||
Person GetPerson(string name);
|
||||
Person? GetPerson(string name);
|
||||
|
||||
/// <summary>
|
||||
/// Finds the by path.
|
||||
@@ -94,7 +92,7 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="isFolder"><c>true</c> is the path is a directory; otherwise <c>false</c>.</param>
|
||||
/// <returns>BaseItem.</returns>
|
||||
BaseItem FindByPath(string path, bool? isFolder);
|
||||
BaseItem? FindByPath(string path, bool? isFolder);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the artist.
|
||||
@@ -166,7 +164,8 @@ namespace MediaBrowser.Controller.Library
|
||||
/// </summary>
|
||||
/// <param name="id">The id.</param>
|
||||
/// <returns>BaseItem.</returns>
|
||||
BaseItem GetItemById(Guid id);
|
||||
/// <exception cref="ArgumentNullException"><paramref name="id"/> is <c>null</c>.</exception>
|
||||
BaseItem? GetItemById(Guid id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the item by id, as T.
|
||||
@@ -174,7 +173,7 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <param name="id">The item id.</param>
|
||||
/// <typeparam name="T">The type of item.</typeparam>
|
||||
/// <returns>The item.</returns>
|
||||
T GetItemById<T>(Guid id)
|
||||
T? GetItemById<T>(Guid id)
|
||||
where T : BaseItem;
|
||||
|
||||
/// <summary>
|
||||
@@ -184,7 +183,7 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <param name="userId">The user id to validate against.</param>
|
||||
/// <typeparam name="T">The type of item.</typeparam>
|
||||
/// <returns>The item if found.</returns>
|
||||
public T GetItemById<T>(Guid id, Guid userId)
|
||||
public T? GetItemById<T>(Guid id, Guid userId)
|
||||
where T : BaseItem;
|
||||
|
||||
/// <summary>
|
||||
@@ -194,7 +193,7 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <param name="user">The user to validate against.</param>
|
||||
/// <typeparam name="T">The type of item.</typeparam>
|
||||
/// <returns>The item if found.</returns>
|
||||
public T GetItemById<T>(Guid id, User user)
|
||||
public T? GetItemById<T>(Guid id, User? user)
|
||||
where T : BaseItem;
|
||||
|
||||
/// <summary>
|
||||
@@ -228,9 +227,9 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <param name="sortBy">The sort by.</param>
|
||||
/// <param name="sortOrder">The sort order.</param>
|
||||
/// <returns>IEnumerable{BaseItem}.</returns>
|
||||
IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<ItemSortBy> sortBy, SortOrder sortOrder);
|
||||
IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User? user, IEnumerable<ItemSortBy> sortBy, SortOrder sortOrder);
|
||||
|
||||
IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<(ItemSortBy OrderBy, SortOrder SortOrder)> orderBy);
|
||||
IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User? user, IEnumerable<(ItemSortBy OrderBy, SortOrder SortOrder)> orderBy);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user root folder.
|
||||
@@ -243,7 +242,7 @@ namespace MediaBrowser.Controller.Library
|
||||
/// </summary>
|
||||
/// <param name="item">Item to create.</param>
|
||||
/// <param name="parent">Parent of new item.</param>
|
||||
void CreateItem(BaseItem item, BaseItem parent);
|
||||
void CreateItem(BaseItem item, BaseItem? parent);
|
||||
|
||||
/// <summary>
|
||||
/// Creates the items.
|
||||
@@ -251,7 +250,7 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <param name="items">Items to create.</param>
|
||||
/// <param name="parent">Parent of new items.</param>
|
||||
/// <param name="cancellationToken">CancellationToken to use for operation.</param>
|
||||
void CreateItems(IReadOnlyList<BaseItem> items, BaseItem parent, CancellationToken cancellationToken);
|
||||
void CreateItems(IReadOnlyList<BaseItem> items, BaseItem? parent, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the item.
|
||||
@@ -529,7 +528,7 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <returns>QueryResult<BaseItem>.</returns>
|
||||
QueryResult<BaseItem> QueryItems(InternalItemsQuery query);
|
||||
|
||||
string GetPathAfterNetworkSubstitution(string path, BaseItem ownerItem = null);
|
||||
string GetPathAfterNetworkSubstitution(string path, BaseItem? ownerItem = null);
|
||||
|
||||
/// <summary>
|
||||
/// Converts the image to local.
|
||||
|
||||
@@ -14,6 +14,6 @@ namespace MediaBrowser.Controller.Resolvers
|
||||
/// <param name="fileInfo">The file information.</param>
|
||||
/// <param name="parent">The parent BaseItem.</param>
|
||||
/// <returns>True if the file should be ignored.</returns>
|
||||
bool ShouldIgnore(FileSystemMetadata fileInfo, BaseItem parent);
|
||||
bool ShouldIgnore(FileSystemMetadata fileInfo, BaseItem? parent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user