aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Library
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Library')
-rw-r--r--MediaBrowser.Controller/Library/DeleteOptions.cs3
-rw-r--r--MediaBrowser.Controller/Library/IIntroProvider.cs4
-rw-r--r--MediaBrowser.Controller/Library/ILibraryManager.cs84
-rw-r--r--MediaBrowser.Controller/Library/ILibraryMonitor.cs2
-rw-r--r--MediaBrowser.Controller/Library/ILibraryPostScanTask.cs2
-rw-r--r--MediaBrowser.Controller/Library/ILiveStream.cs13
-rw-r--r--MediaBrowser.Controller/Library/IMediaSourceManager.cs5
-rw-r--r--MediaBrowser.Controller/Library/IMetadataFileSaver.cs2
-rw-r--r--MediaBrowser.Controller/Library/IMetadataSaver.cs2
-rw-r--r--MediaBrowser.Controller/Library/IMusicManager.cs3
-rw-r--r--MediaBrowser.Controller/Library/ISearchEngine.cs2
-rw-r--r--MediaBrowser.Controller/Library/IUserDataManager.cs12
-rw-r--r--MediaBrowser.Controller/Library/IUserManager.cs121
-rw-r--r--MediaBrowser.Controller/Library/IUserViewManager.cs3
-rw-r--r--MediaBrowser.Controller/Library/IntroInfo.cs2
-rw-r--r--MediaBrowser.Controller/Library/ItemChangeEventArgs.cs4
-rw-r--r--MediaBrowser.Controller/Library/ItemResolveArgs.cs22
-rw-r--r--MediaBrowser.Controller/Library/ItemUpdateType.cs2
-rw-r--r--MediaBrowser.Controller/Library/LibraryManagerExtensions.cs2
-rw-r--r--MediaBrowser.Controller/Library/MetadataConfigurationStore.cs2
-rw-r--r--MediaBrowser.Controller/Library/NameExtensions.cs5
-rw-r--r--MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs24
-rw-r--r--MediaBrowser.Controller/Library/PlaybackStartEventArgs.cs9
-rw-r--r--MediaBrowser.Controller/Library/PlaybackStopEventArgs.cs2
-rw-r--r--MediaBrowser.Controller/Library/Profiler.cs31
-rw-r--r--MediaBrowser.Controller/Library/SearchHintInfo.cs2
-rw-r--r--MediaBrowser.Controller/Library/TVUtils.cs5
-rw-r--r--MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs4
28 files changed, 231 insertions, 143 deletions
diff --git a/MediaBrowser.Controller/Library/DeleteOptions.cs b/MediaBrowser.Controller/Library/DeleteOptions.cs
index 751b90481..b7417efcb 100644
--- a/MediaBrowser.Controller/Library/DeleteOptions.cs
+++ b/MediaBrowser.Controller/Library/DeleteOptions.cs
@@ -1,8 +1,11 @@
+#pragma warning disable CS1591
+
namespace MediaBrowser.Controller.Library
{
public class DeleteOptions
{
public bool DeleteFileLocation { get; set; }
+
public bool DeleteFromExternalProvider { get; set; }
public DeleteOptions()
diff --git a/MediaBrowser.Controller/Library/IIntroProvider.cs b/MediaBrowser.Controller/Library/IIntroProvider.cs
index d9d1ca8c7..d45493d40 100644
--- a/MediaBrowser.Controller/Library/IIntroProvider.cs
+++ b/MediaBrowser.Controller/Library/IIntroProvider.cs
@@ -5,7 +5,7 @@ using MediaBrowser.Controller.Entities;
namespace MediaBrowser.Controller.Library
{
/// <summary>
- /// Class BaseIntroProvider
+ /// Class BaseIntroProvider.
/// </summary>
public interface IIntroProvider
{
@@ -15,7 +15,7 @@ namespace MediaBrowser.Controller.Library
/// <param name="item">The item.</param>
/// <param name="user">The user.</param>
/// <returns>IEnumerable{System.String}.</returns>
- Task<IEnumerable<IntroInfo>> GetIntros(BaseItem item, User user);
+ Task<IEnumerable<IntroInfo>> GetIntros(BaseItem item, Jellyfin.Data.Entities.User user);
/// <summary>
/// Gets all intro files.
diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs
index 2e1c97f67..32703c2fd 100644
--- a/MediaBrowser.Controller/Library/ILibraryManager.cs
+++ b/MediaBrowser.Controller/Library/ILibraryManager.cs
@@ -1,11 +1,14 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
+using Jellyfin.Data.Entities;
+using Jellyfin.Data.Enums;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
-using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Controller.Sorting;
@@ -14,11 +17,14 @@ using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Querying;
+using Episode = MediaBrowser.Controller.Entities.TV.Episode;
+using Genre = MediaBrowser.Controller.Entities.Genre;
+using Person = MediaBrowser.Controller.Entities.Person;
namespace MediaBrowser.Controller.Library
{
/// <summary>
- /// Interface ILibraryManager
+ /// Interface ILibraryManager.
/// </summary>
public interface ILibraryManager
{
@@ -28,13 +34,15 @@ namespace MediaBrowser.Controller.Library
/// <param name="fileInfo">The file information.</param>
/// <param name="parent">The parent.</param>
/// <returns>BaseItem.</returns>
- BaseItem ResolvePath(FileSystemMetadata fileInfo,
+ BaseItem ResolvePath(
+ FileSystemMetadata fileInfo,
Folder parent = null);
/// <summary>
- /// Resolves a set of files into a list of BaseItem
+ /// Resolves a set of files into a list of BaseItem.
/// </summary>
- IEnumerable<BaseItem> ResolvePaths(IEnumerable<FileSystemMetadata> files,
+ IEnumerable<BaseItem> ResolvePaths(
+ IEnumerable<FileSystemMetadata> files,
IDirectoryService directoryService,
Folder parent,
LibraryOptions libraryOptions,
@@ -47,7 +55,7 @@ namespace MediaBrowser.Controller.Library
AggregateFolder RootFolder { get; }
/// <summary>
- /// Gets a Person
+ /// Gets a Person.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>Task{Person}.</returns>
@@ -57,6 +65,7 @@ namespace MediaBrowser.Controller.Library
/// Finds the by path.
/// </summary>
/// <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);
@@ -66,16 +75,18 @@ namespace MediaBrowser.Controller.Library
/// <param name="name">The name.</param>
/// <returns>Task{Artist}.</returns>
MusicArtist GetArtist(string name);
+
MusicArtist GetArtist(string name, DtoOptions options);
+
/// <summary>
- /// Gets a Studio
+ /// Gets a Studio.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>Task{Studio}.</returns>
Studio GetStudio(string name);
/// <summary>
- /// Gets a Genre
+ /// Gets a Genre.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>Task{Genre}.</returns>
@@ -89,7 +100,7 @@ namespace MediaBrowser.Controller.Library
MusicGenre GetMusicGenre(string name);
/// <summary>
- /// Gets a Year
+ /// Gets a Year.
/// </summary>
/// <param name="value">The value.</param>
/// <returns>Task{Year}.</returns>
@@ -106,7 +117,7 @@ namespace MediaBrowser.Controller.Library
Task ValidatePeople(CancellationToken cancellationToken, IProgress<double> progress);
/// <summary>
- /// Reloads the root media folder
+ /// Reloads the root media folder.
/// </summary>
/// <param name="progress">The progress.</param>
/// <param name="cancellationToken">The cancellation token.</param>
@@ -118,7 +129,7 @@ namespace MediaBrowser.Controller.Library
/// </summary>
void QueueLibraryScan();
- void UpdateImages(BaseItem item);
+ Task UpdateImagesAsync(BaseItem item, bool forceUpdate = false);
/// <summary>
/// Gets the default view.
@@ -173,6 +184,7 @@ namespace MediaBrowser.Controller.Library
/// <param name="sortOrder">The sort order.</param>
/// <returns>IEnumerable{BaseItem}.</returns>
IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<string> sortBy, SortOrder sortOrder);
+
IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<ValueTuple<string, SortOrder>> orderBy);
/// <summary>
@@ -189,13 +201,21 @@ namespace MediaBrowser.Controller.Library
/// <summary>
/// Creates the items.
/// </summary>
- void CreateItems(IEnumerable<BaseItem> items, BaseItem parent, CancellationToken cancellationToken);
+ void CreateItems(IReadOnlyList<BaseItem> items, BaseItem parent, CancellationToken cancellationToken);
/// <summary>
/// Updates the item.
/// </summary>
- void UpdateItems(IEnumerable<BaseItem> items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken);
- void UpdateItem(BaseItem item, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken);
+ Task UpdateItemsAsync(IReadOnlyList<BaseItem> items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Updates the item.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="parent">The parent item.</param>
+ /// <param name="updateReason">The update reason.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ Task UpdateItemAsync(BaseItem item, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken);
/// <summary>
/// Retrieves the item.
@@ -215,6 +235,7 @@ namespace MediaBrowser.Controller.Library
/// Occurs when [item updated].
/// </summary>
event EventHandler<ItemChangeEventArgs> ItemUpdated;
+
/// <summary>
/// Occurs when [item removed].
/// </summary>
@@ -284,7 +305,8 @@ namespace MediaBrowser.Controller.Library
/// <param name="parentId">The parent identifier.</param>
/// <param name="viewType">Type of the view.</param>
/// <param name="sortName">Name of the sort.</param>
- UserView GetNamedView(User user,
+ UserView GetNamedView(
+ User user,
string name,
Guid parentId,
string viewType,
@@ -297,7 +319,8 @@ namespace MediaBrowser.Controller.Library
/// <param name="name">The name.</param>
/// <param name="viewType">Type of the view.</param>
/// <param name="sortName">Name of the sort.</param>
- UserView GetNamedView(User user,
+ UserView GetNamedView(
+ User user,
string name,
string viewType,
string sortName);
@@ -308,7 +331,8 @@ namespace MediaBrowser.Controller.Library
/// <param name="name">The name.</param>
/// <param name="viewType">Type of the view.</param>
/// <param name="sortName">Name of the sort.</param>
- UserView GetNamedView(string name,
+ UserView GetNamedView(
+ string name,
string viewType,
string sortName);
@@ -320,7 +344,8 @@ namespace MediaBrowser.Controller.Library
/// <param name="viewType">Type of the view.</param>
/// <param name="sortName">Name of the sort.</param>
/// <param name="uniqueId">The unique identifier.</param>
- UserView GetNamedView(string name,
+ UserView GetNamedView(
+ string name,
Guid parentId,
string viewType,
string sortName,
@@ -332,7 +357,8 @@ namespace MediaBrowser.Controller.Library
/// <param name="parent">The parent.</param>
/// <param name="viewType">Type of the view.</param>
/// <param name="sortName">Name of the sort.</param>
- UserView GetShadowView(BaseItem parent,
+ UserView GetShadowView(
+ BaseItem parent,
string viewType,
string sortName);
@@ -384,7 +410,9 @@ namespace MediaBrowser.Controller.Library
/// <param name="fileSystemChildren">The file system children.</param>
/// <param name="directoryService">The directory service.</param>
/// <returns>IEnumerable&lt;Trailer&gt;.</returns>
- IEnumerable<Video> FindTrailers(BaseItem owner, List<FileSystemMetadata> fileSystemChildren,
+ IEnumerable<Video> FindTrailers(
+ BaseItem owner,
+ List<FileSystemMetadata> fileSystemChildren,
IDirectoryService directoryService);
/// <summary>
@@ -394,7 +422,9 @@ namespace MediaBrowser.Controller.Library
/// <param name="fileSystemChildren">The file system children.</param>
/// <param name="directoryService">The directory service.</param>
/// <returns>IEnumerable&lt;Video&gt;.</returns>
- IEnumerable<Video> FindExtras(BaseItem owner, List<FileSystemMetadata> fileSystemChildren,
+ IEnumerable<Video> FindExtras(
+ BaseItem owner,
+ List<FileSystemMetadata> fileSystemChildren,
IDirectoryService directoryService);
/// <summary>
@@ -513,21 +543,31 @@ namespace MediaBrowser.Controller.Library
Guid GetMusicGenreId(string name);
Task AddVirtualFolder(string name, string collectionType, LibraryOptions options, bool refreshLibrary);
+
Task RemoveVirtualFolder(string name, bool refreshLibrary);
+
void AddMediaPath(string virtualFolderName, MediaPathInfo path);
+
void UpdateMediaPath(string virtualFolderName, MediaPathInfo path);
+
void RemoveMediaPath(string virtualFolderName, string path);
QueryResult<(BaseItem, ItemCounts)> GetGenres(InternalItemsQuery query);
+
QueryResult<(BaseItem, ItemCounts)> GetMusicGenres(InternalItemsQuery query);
+
QueryResult<(BaseItem, ItemCounts)> GetStudios(InternalItemsQuery query);
+
QueryResult<(BaseItem, ItemCounts)> GetArtists(InternalItemsQuery query);
+
QueryResult<(BaseItem, ItemCounts)> GetAlbumArtists(InternalItemsQuery query);
+
QueryResult<(BaseItem, ItemCounts)> GetAllArtists(InternalItemsQuery query);
int GetCount(InternalItemsQuery query);
- void AddExternalSubtitleStreams(List<MediaStream> streams,
+ void AddExternalSubtitleStreams(
+ List<MediaStream> streams,
string videoPath,
string[] files);
}
diff --git a/MediaBrowser.Controller/Library/ILibraryMonitor.cs b/MediaBrowser.Controller/Library/ILibraryMonitor.cs
index 233cfb197..455054bd1 100644
--- a/MediaBrowser.Controller/Library/ILibraryMonitor.cs
+++ b/MediaBrowser.Controller/Library/ILibraryMonitor.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
namespace MediaBrowser.Controller.Library
diff --git a/MediaBrowser.Controller/Library/ILibraryPostScanTask.cs b/MediaBrowser.Controller/Library/ILibraryPostScanTask.cs
index cba5e8fd7..4032e9d83 100644
--- a/MediaBrowser.Controller/Library/ILibraryPostScanTask.cs
+++ b/MediaBrowser.Controller/Library/ILibraryPostScanTask.cs
@@ -5,7 +5,7 @@ using System.Threading.Tasks;
namespace MediaBrowser.Controller.Library
{
/// <summary>
- /// An interface for tasks that run after the media library scan
+ /// An interface for tasks that run after the media library scan.
/// </summary>
public interface ILibraryPostScanTask
{
diff --git a/MediaBrowser.Controller/Library/ILiveStream.cs b/MediaBrowser.Controller/Library/ILiveStream.cs
index 734932f17..ff25be657 100644
--- a/MediaBrowser.Controller/Library/ILiveStream.cs
+++ b/MediaBrowser.Controller/Library/ILiveStream.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Dto;
@@ -6,13 +8,20 @@ namespace MediaBrowser.Controller.Library
{
public interface ILiveStream
{
- Task Open(CancellationToken openCancellationToken);
- Task Close();
int ConsumerCount { get; set; }
+
string OriginalStreamId { get; set; }
+
string TunerHostId { get; }
+
bool EnableStreamSharing { get; }
+
MediaSourceInfo MediaSource { get; set; }
+
string UniqueId { get; }
+
+ Task Open(CancellationToken openCancellationToken);
+
+ Task Close();
}
}
diff --git a/MediaBrowser.Controller/Library/IMediaSourceManager.cs b/MediaBrowser.Controller/Library/IMediaSourceManager.cs
index 0ceabd0e6..22bf9488f 100644
--- a/MediaBrowser.Controller/Library/IMediaSourceManager.cs
+++ b/MediaBrowser.Controller/Library/IMediaSourceManager.cs
@@ -1,8 +1,11 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
+using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto;
@@ -25,12 +28,14 @@ namespace MediaBrowser.Controller.Library
/// <param name="itemId">The item identifier.</param>
/// <returns>IEnumerable&lt;MediaStream&gt;.</returns>
List<MediaStream> GetMediaStreams(Guid itemId);
+
/// <summary>
/// Gets the media streams.
/// </summary>
/// <param name="mediaSourceId">The media source identifier.</param>
/// <returns>IEnumerable&lt;MediaStream&gt;.</returns>
List<MediaStream> GetMediaStreams(string mediaSourceId);
+
/// <summary>
/// Gets the media streams.
/// </summary>
diff --git a/MediaBrowser.Controller/Library/IMetadataFileSaver.cs b/MediaBrowser.Controller/Library/IMetadataFileSaver.cs
index 5b92388ce..9c6f03a23 100644
--- a/MediaBrowser.Controller/Library/IMetadataFileSaver.cs
+++ b/MediaBrowser.Controller/Library/IMetadataFileSaver.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using MediaBrowser.Controller.Entities;
namespace MediaBrowser.Controller.Library
diff --git a/MediaBrowser.Controller/Library/IMetadataSaver.cs b/MediaBrowser.Controller/Library/IMetadataSaver.cs
index dd119984e..027cc5b40 100644
--- a/MediaBrowser.Controller/Library/IMetadataSaver.cs
+++ b/MediaBrowser.Controller/Library/IMetadataSaver.cs
@@ -4,7 +4,7 @@ using MediaBrowser.Controller.Entities;
namespace MediaBrowser.Controller.Library
{
/// <summary>
- /// Interface IMetadataSaver
+ /// Interface IMetadataSaver.
/// </summary>
public interface IMetadataSaver
{
diff --git a/MediaBrowser.Controller/Library/IMusicManager.cs b/MediaBrowser.Controller/Library/IMusicManager.cs
index 554dd0895..d12f008e7 100644
--- a/MediaBrowser.Controller/Library/IMusicManager.cs
+++ b/MediaBrowser.Controller/Library/IMusicManager.cs
@@ -1,4 +1,7 @@
+#pragma warning disable CS1591
+
using System.Collections.Generic;
+using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
diff --git a/MediaBrowser.Controller/Library/ISearchEngine.cs b/MediaBrowser.Controller/Library/ISearchEngine.cs
index 8498b92ae..31dcbba5b 100644
--- a/MediaBrowser.Controller/Library/ISearchEngine.cs
+++ b/MediaBrowser.Controller/Library/ISearchEngine.cs
@@ -4,7 +4,7 @@ using MediaBrowser.Model.Search;
namespace MediaBrowser.Controller.Library
{
/// <summary>
- /// Interface ILibrarySearchEngine
+ /// Interface ILibrarySearchEngine.
/// </summary>
public interface ISearchEngine
{
diff --git a/MediaBrowser.Controller/Library/IUserDataManager.cs b/MediaBrowser.Controller/Library/IUserDataManager.cs
index eb735d31a..c6a83e4dc 100644
--- a/MediaBrowser.Controller/Library/IUserDataManager.cs
+++ b/MediaBrowser.Controller/Library/IUserDataManager.cs
@@ -1,6 +1,9 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Threading;
+using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dto;
@@ -27,7 +30,8 @@ namespace MediaBrowser.Controller.Library
/// <param name="reason">The reason.</param>
/// <param name="cancellationToken">The cancellation token.</param>
void SaveUserData(Guid userId, BaseItem item, UserItemData userData, UserDataSaveReason reason, CancellationToken cancellationToken);
- void SaveUserData(User userId, BaseItem item, UserItemData userData, UserDataSaveReason reason, CancellationToken cancellationToken);
+
+ void SaveUserData(User user, BaseItem item, UserItemData userData, UserDataSaveReason reason, CancellationToken cancellationToken);
UserItemData GetUserData(User user, BaseItem item);
@@ -41,14 +45,14 @@ namespace MediaBrowser.Controller.Library
UserItemDataDto GetUserDataDto(BaseItem item, BaseItemDto itemDto, User user, DtoOptions dto_options);
/// <summary>
- /// Get all user data for the given user
+ /// Get all user data for the given user.
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
List<UserItemData> GetAllUserData(Guid userId);
/// <summary>
- /// Save the all provided user data for the given user
+ /// Save the all provided user data for the given user.
/// </summary>
/// <param name="userId"></param>
/// <param name="userData"></param>
@@ -57,7 +61,7 @@ namespace MediaBrowser.Controller.Library
void SaveAllUserData(Guid userId, UserItemData[] userData, CancellationToken cancellationToken);
/// <summary>
- /// Updates playstate for an item and returns true or false indicating if it was played to completion
+ /// Updates playstate for an item and returns true or false indicating if it was played to completion.
/// </summary>
bool UpdatePlayState(BaseItem item, UserItemData data, long? positionTicks);
}
diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.cs
index be7b4ce59..6a4f5cf67 100644
--- a/MediaBrowser.Controller/Library/IUserManager.cs
+++ b/MediaBrowser.Controller/Library/IUserManager.cs
@@ -1,22 +1,27 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
-using System.Threading;
using System.Threading.Tasks;
-using MediaBrowser.Controller.Authentication;
-using MediaBrowser.Controller.Entities;
+using Jellyfin.Data.Entities;
+using Jellyfin.Data.Events;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Events;
using MediaBrowser.Model.Users;
namespace MediaBrowser.Controller.Library
{
/// <summary>
- /// Interface IUserManager
+ /// Interface IUserManager.
/// </summary>
public interface IUserManager
{
/// <summary>
+ /// Occurs when a user is updated.
+ /// </summary>
+ event EventHandler<GenericEventArgs<User>> OnUserUpdated;
+
+ /// <summary>
/// Gets the users.
/// </summary>
/// <value>The users.</value>
@@ -29,24 +34,9 @@ namespace MediaBrowser.Controller.Library
IEnumerable<Guid> UsersIds { get; }
/// <summary>
- /// Occurs when [user updated].
- /// </summary>
- event EventHandler<GenericEventArgs<User>> UserUpdated;
-
- /// <summary>
- /// Occurs when [user deleted].
+ /// Initializes the user manager and ensures that a user exists.
/// </summary>
- event EventHandler<GenericEventArgs<User>> UserDeleted;
-
- event EventHandler<GenericEventArgs<User>> UserCreated;
-
- event EventHandler<GenericEventArgs<User>> UserPolicyUpdated;
-
- event EventHandler<GenericEventArgs<User>> UserConfigurationUpdated;
-
- event EventHandler<GenericEventArgs<User>> UserPasswordChanged;
-
- event EventHandler<GenericEventArgs<User>> UserLockedOut;
+ Task InitializeAsync();
/// <summary>
/// Gets a user by Id.
@@ -64,13 +54,6 @@ namespace MediaBrowser.Controller.Library
User GetUserByName(string name);
/// <summary>
- /// Refreshes metadata for each user
- /// </summary>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task.</returns>
- Task RefreshUsersMetadata(CancellationToken cancellationToken);
-
- /// <summary>
/// Renames the user.
/// </summary>
/// <param name="user">The user.</param>
@@ -89,20 +72,28 @@ namespace MediaBrowser.Controller.Library
void UpdateUser(User user);
/// <summary>
- /// Creates the user.
+ /// Updates the user.
/// </summary>
- /// <param name="name">The name.</param>
- /// <returns>User.</returns>
+ /// <param name="user">The user.</param>
+ /// <exception cref="ArgumentNullException">If user is <c>null</c>.</exception>
+ /// <exception cref="ArgumentException">If the provided user doesn't exist.</exception>
+ /// <returns>A task representing the update of the user.</returns>
+ Task UpdateUserAsync(User user);
+
+ /// <summary>
+ /// Creates a user with the specified name.
+ /// </summary>
+ /// <param name="name">The name of the new user.</param>
+ /// <returns>The created user.</returns>
/// <exception cref="ArgumentNullException">name</exception>
/// <exception cref="ArgumentException"></exception>
- User CreateUser(string name);
+ Task<User> CreateUserAsync(string name);
/// <summary>
- /// Deletes the user.
+ /// Deletes the specified user.
/// </summary>
- /// <param name="user">The user.</param>
- /// <returns>Task.</returns>
- void DeleteUser(User user);
+ /// <param name="userId">The id of the user to be deleted.</param>
+ void DeleteUser(Guid userId);
/// <summary>
/// Resets the password.
@@ -112,13 +103,6 @@ namespace MediaBrowser.Controller.Library
Task ResetPassword(User user);
/// <summary>
- /// Gets the offline user dto.
- /// </summary>
- /// <param name="user">The user.</param>
- /// <returns>UserDto.</returns>
- UserDto GetOfflineUserDto(User user);
-
- /// <summary>
/// Resets the easy password.
/// </summary>
/// <param name="user">The user.</param>
@@ -163,47 +147,32 @@ namespace MediaBrowser.Controller.Library
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
Task<PinRedeemResult> RedeemPasswordResetPin(string pin);
- /// <summary>
- /// Gets the user policy.
- /// </summary>
- /// <param name="user">The user.</param>
- /// <returns>UserPolicy.</returns>
- UserPolicy GetUserPolicy(User user);
+ NameIdPair[] GetAuthenticationProviders();
- /// <summary>
- /// Gets the user configuration.
- /// </summary>
- /// <param name="user">The user.</param>
- /// <returns>UserConfiguration.</returns>
- UserConfiguration GetUserConfiguration(User user);
+ NameIdPair[] GetPasswordResetProviders();
/// <summary>
- /// Updates the configuration.
+ /// This method updates the user's configuration.
+ /// This is only included as a stopgap until the new API, using this internally is not recommended.
+ /// Instead, modify the user object directly, then call <see cref="UpdateUser"/>.
/// </summary>
- /// <param name="userId">The user identifier.</param>
- /// <param name="newConfiguration">The new configuration.</param>
- /// <returns>Task.</returns>
- void UpdateConfiguration(Guid userId, UserConfiguration newConfiguration);
-
- void UpdateConfiguration(User user, UserConfiguration newConfiguration);
+ /// <param name="userId">The user's Id.</param>
+ /// <param name="config">The request containing the new user configuration.</param>
+ void UpdateConfiguration(Guid userId, UserConfiguration config);
/// <summary>
- /// Updates the user policy.
+ /// This method updates the user's policy.
+ /// This is only included as a stopgap until the new API, using this internally is not recommended.
+ /// Instead, modify the user object directly, then call <see cref="UpdateUser"/>.
/// </summary>
- /// <param name="userId">The user identifier.</param>
- /// <param name="userPolicy">The user policy.</param>
- void UpdateUserPolicy(Guid userId, UserPolicy userPolicy);
+ /// <param name="userId">The user's Id.</param>
+ /// <param name="policy">The request containing the new user policy.</param>
+ void UpdatePolicy(Guid userId, UserPolicy policy);
/// <summary>
- /// Makes the valid username.
+ /// Clears the user's profile image.
/// </summary>
- /// <param name="username">The username.</param>
- /// <returns>System.String.</returns>
- string MakeValidUsername(string username);
-
- void AddParts(IEnumerable<IAuthenticationProvider> authenticationProviders, IEnumerable<IPasswordResetProvider> passwordResetProviders);
-
- NameIdPair[] GetAuthenticationProviders();
- NameIdPair[] GetPasswordResetProviders();
+ /// <param name="user">The user.</param>
+ void ClearProfileImage(User user);
}
}
diff --git a/MediaBrowser.Controller/Library/IUserViewManager.cs b/MediaBrowser.Controller/Library/IUserViewManager.cs
index 0d7da7579..8d541e8b6 100644
--- a/MediaBrowser.Controller/Library/IUserViewManager.cs
+++ b/MediaBrowser.Controller/Library/IUserViewManager.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using MediaBrowser.Controller.Dto;
@@ -10,6 +12,7 @@ namespace MediaBrowser.Controller.Library
public interface IUserViewManager
{
Folder[] GetUserViews(UserViewQuery query);
+
UserView GetUserSubView(Guid parentId, string type, string localizationKey, string sortName);
List<Tuple<BaseItem, List<BaseItem>>> GetLatestItems(LatestItemsQuery request, DtoOptions options);
diff --git a/MediaBrowser.Controller/Library/IntroInfo.cs b/MediaBrowser.Controller/Library/IntroInfo.cs
index 0e761d549..283cc631c 100644
--- a/MediaBrowser.Controller/Library/IntroInfo.cs
+++ b/MediaBrowser.Controller/Library/IntroInfo.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
namespace MediaBrowser.Controller.Library
diff --git a/MediaBrowser.Controller/Library/ItemChangeEventArgs.cs b/MediaBrowser.Controller/Library/ItemChangeEventArgs.cs
index c9671de47..1798a4fad 100644
--- a/MediaBrowser.Controller/Library/ItemChangeEventArgs.cs
+++ b/MediaBrowser.Controller/Library/ItemChangeEventArgs.cs
@@ -1,9 +1,11 @@
+#pragma warning disable CS1591
+
using MediaBrowser.Controller.Entities;
namespace MediaBrowser.Controller.Library
{
/// <summary>
- /// Class ItemChangeEventArgs
+ /// Class ItemChangeEventArgs.
/// </summary>
public class ItemChangeEventArgs
{
diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs
index 0222b926e..12a311dc3 100644
--- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs
+++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -15,7 +17,7 @@ namespace MediaBrowser.Controller.Library
public class ItemResolveArgs : EventArgs
{
/// <summary>
- /// The _app paths
+ /// The _app paths.
/// </summary>
private readonly IServerApplicationPaths _appPaths;
@@ -42,7 +44,7 @@ namespace MediaBrowser.Controller.Library
public LibraryOptions GetLibraryOptions()
{
- return LibraryOptions ?? (LibraryOptions = (Parent == null ? new LibraryOptions() : BaseItem.LibraryManager.GetLibraryOptions(Parent)));
+ return LibraryOptions ?? (LibraryOptions = Parent == null ? new LibraryOptions() : BaseItem.LibraryManager.GetLibraryOptions(Parent));
}
/// <summary>
@@ -89,7 +91,6 @@ namespace MediaBrowser.Controller.Library
return parentDir.Length > _appPaths.RootFolderPath.Length
&& parentDir.StartsWith(_appPaths.RootFolderPath, StringComparison.OrdinalIgnoreCase);
-
}
}
@@ -129,8 +130,8 @@ namespace MediaBrowser.Controller.Library
}
return item != null;
-
}
+
return false;
}
@@ -155,6 +156,7 @@ namespace MediaBrowser.Controller.Library
}
// REVIEW: @bond
+
/// <summary>
/// Gets the physical locations.
/// </summary>
@@ -225,8 +227,6 @@ namespace MediaBrowser.Controller.Library
public string CollectionType { get; set; }
- #region Equality Overrides
-
/// <summary>
/// Determines whether the specified <see cref="object" /> is equal to this instance.
/// </summary>
@@ -255,13 +255,15 @@ namespace MediaBrowser.Controller.Library
{
if (args != null)
{
- if (args.Path == null && Path == null) return true;
+ if (args.Path == null && Path == null)
+ {
+ return true;
+ }
+
return args.Path != null && BaseItem.FileSystem.AreEqual(args.Path, Path);
}
+
return false;
}
-
- #endregion
}
-
}
diff --git a/MediaBrowser.Controller/Library/ItemUpdateType.cs b/MediaBrowser.Controller/Library/ItemUpdateType.cs
index b62f314ba..1f3ebb499 100644
--- a/MediaBrowser.Controller/Library/ItemUpdateType.cs
+++ b/MediaBrowser.Controller/Library/ItemUpdateType.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
namespace MediaBrowser.Controller.Library
diff --git a/MediaBrowser.Controller/Library/LibraryManagerExtensions.cs b/MediaBrowser.Controller/Library/LibraryManagerExtensions.cs
index 037b0b62c..9581603f0 100644
--- a/MediaBrowser.Controller/Library/LibraryManagerExtensions.cs
+++ b/MediaBrowser.Controller/Library/LibraryManagerExtensions.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using MediaBrowser.Controller.Entities;
diff --git a/MediaBrowser.Controller/Library/MetadataConfigurationStore.cs b/MediaBrowser.Controller/Library/MetadataConfigurationStore.cs
index 31adbdcf3..f16304db0 100644
--- a/MediaBrowser.Controller/Library/MetadataConfigurationStore.cs
+++ b/MediaBrowser.Controller/Library/MetadataConfigurationStore.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System.Collections.Generic;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Model.Configuration;
diff --git a/MediaBrowser.Controller/Library/NameExtensions.cs b/MediaBrowser.Controller/Library/NameExtensions.cs
index 24d0347e9..1c90bb4e0 100644
--- a/MediaBrowser.Controller/Library/NameExtensions.cs
+++ b/MediaBrowser.Controller/Library/NameExtensions.cs
@@ -1,3 +1,6 @@
+#nullable enable
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -7,7 +10,7 @@ namespace MediaBrowser.Controller.Library
{
public static class NameExtensions
{
- private static string RemoveDiacritics(string name)
+ private static string RemoveDiacritics(string? name)
{
if (name == null)
{
diff --git a/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs b/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs
index b0302d04c..a2be3a42a 100644
--- a/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs
+++ b/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs
@@ -1,5 +1,8 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
+using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Dto;
@@ -7,28 +10,37 @@ using MediaBrowser.Model.Dto;
namespace MediaBrowser.Controller.Library
{
/// <summary>
- /// Holds information about a playback progress event
+ /// Holds information about a playback progress event.
/// </summary>
public class PlaybackProgressEventArgs : EventArgs
{
+ public PlaybackProgressEventArgs()
+ {
+ Users = new List<User>();
+ }
+
public List<User> Users { get; set; }
+
public long? PlaybackPositionTicks { get; set; }
+
public BaseItem Item { get; set; }
+
public BaseItemDto MediaInfo { get; set; }
+
public string MediaSourceId { get; set; }
+
public bool IsPaused { get; set; }
+
public bool IsAutomated { get; set; }
public string DeviceId { get; set; }
+
public string DeviceName { get; set; }
+
public string ClientName { get; set; }
public string PlaySessionId { get; set; }
- public SessionInfo Session { get; set; }
- public PlaybackProgressEventArgs()
- {
- Users = new List<User>();
- }
+ public SessionInfo Session { get; set; }
}
}
diff --git a/MediaBrowser.Controller/Library/PlaybackStartEventArgs.cs b/MediaBrowser.Controller/Library/PlaybackStartEventArgs.cs
new file mode 100644
index 000000000..ac372bceb
--- /dev/null
+++ b/MediaBrowser.Controller/Library/PlaybackStartEventArgs.cs
@@ -0,0 +1,9 @@
+namespace MediaBrowser.Controller.Library
+{
+ /// <summary>
+ /// An event that occurs when playback is started.
+ /// </summary>
+ public class PlaybackStartEventArgs : PlaybackProgressEventArgs
+ {
+ }
+}
diff --git a/MediaBrowser.Controller/Library/PlaybackStopEventArgs.cs b/MediaBrowser.Controller/Library/PlaybackStopEventArgs.cs
index 12add2573..f0d77ba2d 100644
--- a/MediaBrowser.Controller/Library/PlaybackStopEventArgs.cs
+++ b/MediaBrowser.Controller/Library/PlaybackStopEventArgs.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
namespace MediaBrowser.Controller.Library
{
public class PlaybackStopEventArgs : PlaybackProgressEventArgs
diff --git a/MediaBrowser.Controller/Library/Profiler.cs b/MediaBrowser.Controller/Library/Profiler.cs
index 46a97d181..5efdc6a48 100644
--- a/MediaBrowser.Controller/Library/Profiler.cs
+++ b/MediaBrowser.Controller/Library/Profiler.cs
@@ -1,27 +1,29 @@
using System;
using System.Diagnostics;
+using System.Globalization;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Controller.Library
{
/// <summary>
- /// Class Profiler
+ /// Class Profiler.
/// </summary>
public class Profiler : IDisposable
{
/// <summary>
- /// The name
+ /// The name.
/// </summary>
readonly string _name;
+
/// <summary>
- /// The stopwatch
+ /// The stopwatch.
/// </summary>
readonly Stopwatch _stopwatch;
/// <summary>
- /// The _logger
+ /// The _logger.
/// </summary>
- private readonly ILogger _logger;
+ private readonly ILogger<Profiler> _logger;
/// <summary>
/// Initializes a new instance of the <see cref="Profiler" /> class.
@@ -37,7 +39,6 @@ namespace MediaBrowser.Controller.Library
_stopwatch = new Stopwatch();
_stopwatch.Start();
}
- #region IDisposable Members
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
@@ -45,6 +46,7 @@ namespace MediaBrowser.Controller.Library
public void Dispose()
{
Dispose(true);
+ GC.SuppressFinalize(this);
}
/// <summary>
@@ -59,18 +61,23 @@ namespace MediaBrowser.Controller.Library
string message;
if (_stopwatch.ElapsedMilliseconds > 300000)
{
- message = string.Format("{0} took {1} minutes.",
- _name, ((float)_stopwatch.ElapsedMilliseconds / 60000).ToString("F"));
+ message = string.Format(
+ CultureInfo.InvariantCulture,
+ "{0} took {1} minutes.",
+ _name,
+ ((float)_stopwatch.ElapsedMilliseconds / 60000).ToString("F", CultureInfo.InvariantCulture));
}
else
{
- message = string.Format("{0} took {1} seconds.",
- _name, ((float)_stopwatch.ElapsedMilliseconds / 1000).ToString("#0.000"));
+ message = string.Format(
+ CultureInfo.InvariantCulture,
+ "{0} took {1} seconds.",
+ _name,
+ ((float)_stopwatch.ElapsedMilliseconds / 1000).ToString("#0.000", CultureInfo.InvariantCulture));
}
+
_logger.LogInformation(message);
}
}
-
- #endregion
}
}
diff --git a/MediaBrowser.Controller/Library/SearchHintInfo.cs b/MediaBrowser.Controller/Library/SearchHintInfo.cs
index 692431e34..897c2b7f4 100644
--- a/MediaBrowser.Controller/Library/SearchHintInfo.cs
+++ b/MediaBrowser.Controller/Library/SearchHintInfo.cs
@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Entities;
namespace MediaBrowser.Controller.Library
{
/// <summary>
- /// Class SearchHintInfo
+ /// Class SearchHintInfo.
/// </summary>
public class SearchHintInfo
{
diff --git a/MediaBrowser.Controller/Library/TVUtils.cs b/MediaBrowser.Controller/Library/TVUtils.cs
index fd5fb6748..a3aa6019e 100644
--- a/MediaBrowser.Controller/Library/TVUtils.cs
+++ b/MediaBrowser.Controller/Library/TVUtils.cs
@@ -3,7 +3,7 @@ using System;
namespace MediaBrowser.Controller.Library
{
/// <summary>
- /// Class TVUtils
+ /// Class TVUtils.
/// </summary>
public static class TVUtils
{
@@ -38,8 +38,9 @@ namespace MediaBrowser.Controller.Library
};
}
- return new DayOfWeek[] { };
+ return Array.Empty<DayOfWeek>();
}
+
return null;
}
}
diff --git a/MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs b/MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs
index 3e7351b8b..cd9109753 100644
--- a/MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs
+++ b/MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using MediaBrowser.Controller.Entities;
@@ -6,7 +8,7 @@ using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.Library
{
/// <summary>
- /// Class UserDataSaveEventArgs
+ /// Class UserDataSaveEventArgs.
/// </summary>
public class UserDataSaveEventArgs : EventArgs
{