diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index 7a4ba6a24a..0bd2f38437 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -1,6 +1,6 @@ #nullable disable -#pragma warning disable CS1591 +#pragma warning disable CA1002, CS1591 using System; using System.Collections.Generic; @@ -31,6 +31,29 @@ namespace MediaBrowser.Controller.Library /// public interface ILibraryManager { + /// + /// Occurs when [item added]. + /// + event EventHandler ItemAdded; + + /// + /// Occurs when [item updated]. + /// + event EventHandler ItemUpdated; + + /// + /// Occurs when [item removed]. + /// + event EventHandler ItemRemoved; + + /// + /// Gets the root folder. + /// + /// The root folder. + AggregateFolder RootFolder { get; } + + bool IsScanRunning { get; } + /// /// Resolves the path. /// @@ -57,12 +80,6 @@ namespace MediaBrowser.Controller.Library LibraryOptions libraryOptions, string collectionType = null); - /// - /// Gets the root folder. - /// - /// The root folder. - AggregateFolder RootFolder { get; } - /// /// Gets a Person. /// @@ -113,7 +130,7 @@ namespace MediaBrowser.Controller.Library /// /// The value. /// Task{Year}. - /// + /// Throws if year is invalid. Year GetYear(int value); /// @@ -205,16 +222,26 @@ namespace MediaBrowser.Controller.Library /// /// Creates the item. /// + /// Item to create. + /// Parent of new item. void CreateItem(BaseItem item, BaseItem parent); /// /// Creates the items. /// + /// Items to create. + /// Parent of new items. + /// CancellationToken to use for operation. void CreateItems(IReadOnlyList items, BaseItem parent, CancellationToken cancellationToken); /// /// Updates the item. /// + /// Items to update. + /// Parent of updated items. + /// Reason for update. + /// CancellationToken to use for operation. + /// Returns a Task that can be awaited. Task UpdateItemsAsync(IReadOnlyList items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken); /// @@ -224,6 +251,7 @@ namespace MediaBrowser.Controller.Library /// The parent item. /// The update reason. /// The cancellation token. + /// Returns a Task that can be awaited. Task UpdateItemAsync(BaseItem item, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken); /// @@ -233,23 +261,6 @@ namespace MediaBrowser.Controller.Library /// BaseItem. BaseItem RetrieveItem(Guid id); - bool IsScanRunning { get; } - - /// - /// Occurs when [item added]. - /// - event EventHandler ItemAdded; - - /// - /// Occurs when [item updated]. - /// - event EventHandler ItemUpdated; - - /// - /// Occurs when [item removed]. - /// - event EventHandler ItemRemoved; - /// /// Finds the type of the collection. /// @@ -294,16 +305,25 @@ namespace MediaBrowser.Controller.Library /// /// Deletes the item. /// + /// Item to delete. + /// Options to use for deletion. void DeleteItem(BaseItem item, DeleteOptions options); /// /// Deletes the item. /// + /// Item to delete. + /// Options to use for deletion. + /// Notify parent of deletion. void DeleteItem(BaseItem item, DeleteOptions options, bool notifyParentItem); /// /// Deletes the item. /// + /// Item to delete. + /// Options to use for deletion. + /// Parent of item. + /// Notify parent of deletion. void DeleteItem(BaseItem item, DeleteOptions options, BaseItem parent, bool notifyParentItem); /// @@ -314,6 +334,7 @@ namespace MediaBrowser.Controller.Library /// The parent identifier. /// Type of the view. /// Name of the sort. + /// The named view. UserView GetNamedView( User user, string name, @@ -328,6 +349,7 @@ namespace MediaBrowser.Controller.Library /// The name. /// Type of the view. /// Name of the sort. + /// The named view. UserView GetNamedView( User user, string name, @@ -340,6 +362,7 @@ namespace MediaBrowser.Controller.Library /// The name. /// Type of the view. /// Name of the sort. + /// The named view. UserView GetNamedView( string name, string viewType, @@ -397,6 +420,9 @@ namespace MediaBrowser.Controller.Library /// /// Fills the missing episode numbers from path. /// + /// Episode to use. + /// Option to force refresh of episode numbers. + /// True if successful. bool FillMissingEpisodeNumbersFromPath(Episode episode, bool forceRefresh); /// @@ -539,6 +565,9 @@ namespace MediaBrowser.Controller.Library /// /// Gets the items. /// + /// The query to use. + /// Items to use for query. + /// List of items. List GetItemList(InternalItemsQuery query, List parents); /// diff --git a/MediaBrowser.Controller/Library/ILiveStream.cs b/MediaBrowser.Controller/Library/ILiveStream.cs index 85d866de5c..323aa48768 100644 --- a/MediaBrowser.Controller/Library/ILiveStream.cs +++ b/MediaBrowser.Controller/Library/ILiveStream.cs @@ -1,6 +1,6 @@ #nullable disable -#pragma warning disable CS1591 +#pragma warning disable CA1711, CS1591 using System.Threading; using System.Threading.Tasks; diff --git a/MediaBrowser.Controller/Library/IMediaSourceManager.cs b/MediaBrowser.Controller/Library/IMediaSourceManager.cs index d3d85a0563..fd3631da9c 100644 --- a/MediaBrowser.Controller/Library/IMediaSourceManager.cs +++ b/MediaBrowser.Controller/Library/IMediaSourceManager.cs @@ -1,6 +1,6 @@ #nullable disable -#pragma warning disable CS1591 +#pragma warning disable CA1002, CS1591 using System; using System.Collections.Generic; @@ -62,16 +62,32 @@ namespace MediaBrowser.Controller.Library /// /// Gets the playack media sources. /// + /// Item to use. + /// User to use for operation. + /// Option to allow media probe. + /// Option to enable path substitution. + /// CancellationToken to use for operation. + /// List of media sources wrapped in an awaitable task. Task> GetPlaybackMediaSources(BaseItem item, User user, bool allowMediaProbe, bool enablePathSubstitution, CancellationToken cancellationToken); /// /// Gets the static media sources. /// + /// Item to use. + /// Option to enable path substitution. + /// User to use for operation. + /// List of media sources. List GetStaticMediaSources(BaseItem item, bool enablePathSubstitution, User user = null); /// /// Gets the static media source. /// + /// Item to use. + /// Media source to get. + /// Live stream to use. + /// Option to enable path substitution. + /// CancellationToken to use for operation. + /// The static media source wrapped in an awaitable task. Task GetMediaSource(BaseItem item, string mediaSourceId, string liveStreamId, bool enablePathSubstitution, CancellationToken cancellationToken); /// diff --git a/MediaBrowser.Controller/Library/IMediaSourceProvider.cs b/MediaBrowser.Controller/Library/IMediaSourceProvider.cs index 5bf4acebb4..ca4b53fbee 100644 --- a/MediaBrowser.Controller/Library/IMediaSourceProvider.cs +++ b/MediaBrowser.Controller/Library/IMediaSourceProvider.cs @@ -1,4 +1,4 @@ -#pragma warning disable CS1591 +#pragma warning disable CA1002, CS1591 using System.Collections.Generic; using System.Threading; @@ -21,6 +21,10 @@ namespace MediaBrowser.Controller.Library /// /// Opens the media source. /// + /// Token to use. + /// List of live streams. + /// CancellationToken to use for operation. + /// The media source wrapped as an awaitable task. Task OpenMediaSource(string openToken, List currentLiveStreams, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/Library/IMetadataSaver.cs b/MediaBrowser.Controller/Library/IMetadataSaver.cs index 5fbfad8814..d963fd2491 100644 --- a/MediaBrowser.Controller/Library/IMetadataSaver.cs +++ b/MediaBrowser.Controller/Library/IMetadataSaver.cs @@ -29,7 +29,6 @@ namespace MediaBrowser.Controller.Library /// /// The item. /// The cancellation token. - /// Task. void Save(BaseItem item, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/Library/IMusicManager.cs b/MediaBrowser.Controller/Library/IMusicManager.cs index 5329841bf5..ec34a868b3 100644 --- a/MediaBrowser.Controller/Library/IMusicManager.cs +++ b/MediaBrowser.Controller/Library/IMusicManager.cs @@ -1,6 +1,6 @@ #nullable disable -#pragma warning disable CS1591 +#pragma warning disable CA1002, CS1591 using System.Collections.Generic; using Jellyfin.Data.Entities; @@ -15,16 +15,28 @@ namespace MediaBrowser.Controller.Library /// /// Gets the instant mix from song. /// + /// The item to use. + /// The user to use. + /// The options to use. + /// List of items. List GetInstantMixFromItem(BaseItem item, User user, DtoOptions dtoOptions); /// /// Gets the instant mix from artist. /// + /// The artist to use. + /// The user to use. + /// The options to use. + /// List of items. List GetInstantMixFromArtist(MusicArtist artist, User user, DtoOptions dtoOptions); /// /// Gets the instant mix from genre. /// + /// The genres to use. + /// The user to use. + /// The options to use. + /// List of items. List GetInstantMixFromGenres(IEnumerable genres, User user, DtoOptions dtoOptions); } } diff --git a/MediaBrowser.Controller/Library/IUserDataManager.cs b/MediaBrowser.Controller/Library/IUserDataManager.cs index e5dcfcff04..cf35b48dba 100644 --- a/MediaBrowser.Controller/Library/IUserDataManager.cs +++ b/MediaBrowser.Controller/Library/IUserDataManager.cs @@ -1,6 +1,6 @@ #nullable disable -#pragma warning disable CS1591 +#pragma warning disable CA1002, CA1707, CS1591 using System; using System.Collections.Generic; @@ -42,6 +42,9 @@ namespace MediaBrowser.Controller.Library /// /// Gets the user data dto. /// + /// Item to use. + /// User to use. + /// User data dto. UserItemDataDto GetUserDataDto(BaseItem item, User user); UserItemDataDto GetUserDataDto(BaseItem item, BaseItemDto itemDto, User user, DtoOptions dto_options); @@ -64,6 +67,10 @@ namespace MediaBrowser.Controller.Library /// /// Updates playstate for an item and returns true or false indicating if it was played to completion. /// + /// Item to update. + /// Data to update. + /// New playstate. + /// True if playstate was updated. bool UpdatePlayState(BaseItem item, UserItemData data, long? positionTicks); } } diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.cs index 1801b1c413..21776f8915 100644 --- a/MediaBrowser.Controller/Library/IUserManager.cs +++ b/MediaBrowser.Controller/Library/IUserManager.cs @@ -38,6 +38,7 @@ namespace MediaBrowser.Controller.Library /// /// Initializes the user manager and ensures that a user exists. /// + /// Awaitable task. Task InitializeAsync(); /// @@ -109,17 +110,22 @@ namespace MediaBrowser.Controller.Library /// Resets the easy password. /// /// The user. - /// Task. void ResetEasyPassword(User user); /// /// Changes the password. /// + /// The user. + /// New password to use. + /// Awaitable task. Task ChangePassword(User user, string newPassword); /// /// Changes the easy password. /// + /// The user. + /// New password to use. + /// Hash of new password. void ChangeEasyPassword(User user, string newPassword, string newPasswordSha1); /// @@ -133,6 +139,12 @@ namespace MediaBrowser.Controller.Library /// /// Authenticates the user. /// + /// The user. + /// The password to use. + /// Hash of password. + /// Remove endpoint to use. + /// Specifies if a user session. + /// User wrapped in awaitable task. Task AuthenticateUser(string username, string password, string passwordSha1, string remoteEndPoint, bool isUserSession); /// diff --git a/MediaBrowser.Controller/Library/IUserViewManager.cs b/MediaBrowser.Controller/Library/IUserViewManager.cs index 46004e42f7..055627d3e3 100644 --- a/MediaBrowser.Controller/Library/IUserViewManager.cs +++ b/MediaBrowser.Controller/Library/IUserViewManager.cs @@ -1,6 +1,6 @@ #nullable disable -#pragma warning disable CS1591 +#pragma warning disable CA1002, CS1591 using System; using System.Collections.Generic; @@ -13,10 +13,29 @@ namespace MediaBrowser.Controller.Library { public interface IUserViewManager { + /// + /// Gets user views. + /// + /// Query to use. + /// Set of folders. Folder[] GetUserViews(UserViewQuery query); + /// + /// Gets user sub views. + /// + /// Parent to use. + /// Type to use. + /// Localization key to use. + /// Sort to use. + /// User view. UserView GetUserSubView(Guid parentId, string type, string localizationKey, string sortName); + /// + /// Gets latest items. + /// + /// Query to use. + /// Options to use. + /// Set of items. List>> GetLatestItems(LatestItemsQuery request, DtoOptions options); } } diff --git a/MediaBrowser.Controller/Library/ItemChangeEventArgs.cs b/MediaBrowser.Controller/Library/ItemChangeEventArgs.cs index a37dc7af11..3586dc69d6 100644 --- a/MediaBrowser.Controller/Library/ItemChangeEventArgs.cs +++ b/MediaBrowser.Controller/Library/ItemChangeEventArgs.cs @@ -1,6 +1,6 @@ #nullable disable -#pragma warning disable CS1591 +#pragma warning disable CA1711, CS1591 using MediaBrowser.Controller.Entities; diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index 521e372742..bfc1e4857f 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -1,6 +1,6 @@ #nullable disable -#pragma warning disable CS1591 +#pragma warning disable CA1721, CA1819, CS1591 using System; using System.Collections.Generic; @@ -109,6 +109,21 @@ namespace MediaBrowser.Controller.Library /// The additional locations. private List AdditionalLocations { get; set; } + /// + /// Gets the physical locations. + /// + /// The physical locations. + public string[] PhysicalLocations + { + get + { + var paths = string.IsNullOrEmpty(Path) ? Array.Empty() : new[] { Path }; + return AdditionalLocations == null ? paths : paths.Concat(AdditionalLocations).ToArray(); + } + } + + public string CollectionType { get; set; } + public bool HasParent() where T : Folder { @@ -138,6 +153,16 @@ namespace MediaBrowser.Controller.Library return false; } + /// + /// Determines whether the specified is equal to this instance. + /// + /// The object to compare with the current object. + /// true if the specified is equal to this instance; otherwise, false. + public override bool Equals(object obj) + { + return Equals(obj as ItemResolveArgs); + } + /// /// Adds the additional location. /// @@ -156,19 +181,6 @@ namespace MediaBrowser.Controller.Library // REVIEW: @bond - /// - /// Gets the physical locations. - /// - /// The physical locations. - public string[] PhysicalLocations - { - get - { - var paths = string.IsNullOrEmpty(Path) ? Array.Empty() : new[] { Path }; - return AdditionalLocations == null ? paths : paths.Concat(AdditionalLocations).ToArray(); - } - } - /// /// Gets the name of the file system entry by. /// @@ -190,7 +202,7 @@ namespace MediaBrowser.Controller.Library /// /// The path. /// FileSystemInfo. - /// + /// Throws if path is invalid. public FileSystemMetadata GetFileSystemEntryByPath(string path) { if (string.IsNullOrEmpty(path)) @@ -224,18 +236,6 @@ namespace MediaBrowser.Controller.Library return CollectionType; } - public string CollectionType { get; set; } - - /// - /// Determines whether the specified is equal to this instance. - /// - /// The object to compare with the current object. - /// true if the specified is equal to this instance; otherwise, false. - public override bool Equals(object obj) - { - return Equals(obj as ItemResolveArgs); - } - /// /// Returns a hash code for this instance. /// diff --git a/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs b/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs index 609336ec4d..76e9eb1f54 100644 --- a/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs +++ b/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs @@ -1,6 +1,6 @@ #nullable disable -#pragma warning disable CS1591 +#pragma warning disable CA1002, CA2227, CS1591 using System; using System.Collections.Generic; diff --git a/MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs b/MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs index bfe433c971..4d90346f29 100644 --- a/MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs +++ b/MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs @@ -1,6 +1,6 @@ #nullable disable -#pragma warning disable CS1591 +#pragma warning disable CA1002, CA2227, CS1591 using System; using System.Collections.Generic;