The Free Software Media System - Server Backend & API
Reduce warnings in MediaBrowser.Controller
crobibero6bcbc2b88ae8
diff --git a/MediaBrowser.Controller/Channels/Channel.cs b/MediaBrowser.Controller/Channels/Channel.csindex 26c64e0da6..26a936be0c 100644--- a/MediaBrowser.Controller/Channels/Channel.cs+++ b/MediaBrowser.Controller/Channels/Channel.cs@@ -84,7 +84,7 @@ namespace MediaBrowser.Controller.Channelsinternal static bool IsChannelVisible(BaseItem channelItem, User user){- var channel = ChannelManager.GetChannel(channelItem.ChannelId.ToString(""));+ var channel = ChannelManager.GetChannel(channelItem.ChannelId.ToString(string.Empty));return channel.IsVisible(user);}diff --git a/MediaBrowser.Controller/Channels/IChannelManager.cs b/MediaBrowser.Controller/Channels/IChannelManager.csindex 4c5626338e..95d95465e0 100644--- a/MediaBrowser.Controller/Channels/IChannelManager.cs+++ b/MediaBrowser.Controller/Channels/IChannelManager.cs@@ -51,32 +51,47 @@ namespace MediaBrowser.Controller.Channels/// Gets the channels internal./// </summary>/// <param name="query">The query.</param>+ /// <returns>The <see cref="QueryResult{T}"/> of <see cref="Channel"/>.</returns>QueryResult<Channel> GetChannelsInternal(ChannelQuery query);/// <summary>/// Gets the channels./// </summary>/// <param name="query">The query.</param>+ /// <returns>The <see cref="QueryResult{T}"/> of <see cref="BaseItemDto"/>.</returns>QueryResult<BaseItemDto> GetChannels(ChannelQuery query);/// <summary>- /// Gets the latest media.+ /// Gets the latest channel items./// </summary>+ /// <param name="query">The item query.</param>+ /// <param name="cancellationToken">The cancellation token.</param>+ /// <returns>A <see cref="Task"/> containing the <see cref="QueryResult{T}"/> of <see cref="BaseItemDto"/>.</returns>Task<QueryResult<BaseItemDto>> GetLatestChannelItems(InternalItemsQuery query, CancellationToken cancellationToken);/// <summary>- /// Gets the latest media.+ /// Gets the latest channel items./// </summary>+ /// <param name="query">The item query.</param>+ /// <param name="cancellationToken">The cancellation token.</param>+ /// <returns>A <see cref="Task"/> containing the <see cref="QueryResult{T}"/> of <see cref="BaseItem"/>.</returns>Task<QueryResult<BaseItem>> GetLatestChannelItemsInternal(InternalItemsQuery query, CancellationToken cancellationToken);/// <summary>/// Gets the channel items./// </summary>+ /// <param name="query">The query.</param>+ /// <param name="cancellationToken">The cancellation token.</param>+ /// <returns>A <see cref="Task"/> containing the <see cref="QueryResult{T}"/> of <see cref="BaseItemDto"/>.</returns>Task<QueryResult<BaseItemDto>> GetChannelItems(InternalItemsQuery query, CancellationToken cancellationToken);/// <summary>- /// Gets the channel items internal.+ /// Gets the channel items./// </summary>+ /// <param name="query">The query.</param>+ /// <param name="progress">The progress to report to.</param>+ /// <param name="cancellationToken">The cancellation token.</param>+ /// <returns>A <see cref="Task"/> containing the <see cref="QueryResult{T}"/> of <see cref="BaseItem"/>.</returns>Task<QueryResult<BaseItem>> GetChannelItemsInternal(InternalItemsQuery query, IProgress<double> progress, CancellationToken cancellationToken);/// <summary>@@ -87,6 +102,11 @@ namespace MediaBrowser.Controller.Channels/// <returns>Task{IEnumerable{MediaSourceInfo}}.</returns>IEnumerable<MediaSourceInfo> GetStaticMediaSources(BaseItem item, CancellationToken cancellationToken);+ /// <summary>+ /// Whether the item supports media probe.+ /// </summary>+ /// <param name="item">The item.</param>+ /// <returns>Whether media probe should be enabled.</returns>bool EnableMediaProbe(BaseItem item);}}diff --git a/MediaBrowser.Controller/Channels/IDisableMediaSourceDisplay.cs b/MediaBrowser.Controller/Channels/IDisableMediaSourceDisplay.csnew file mode 100644index 0000000000..a2dc5682dd--- /dev/null+++ b/MediaBrowser.Controller/Channels/IDisableMediaSourceDisplay.cs@@ -0,0 +1,8 @@+#pragma warning disable CS1591++namespace MediaBrowser.Controller.Channels+{+ public interface IDisableMediaSourceDisplay+ {+ }+}\ No newline at end of filediff --git a/MediaBrowser.Controller/Channels/IHasFolderAttributes.cs b/MediaBrowser.Controller/Channels/IHasFolderAttributes.csnew file mode 100644index 0000000000..47277a8cc8--- /dev/null+++ b/MediaBrowser.Controller/Channels/IHasFolderAttributes.cs@@ -0,0 +1,9 @@+#pragma warning disable CS1591++namespace MediaBrowser.Controller.Channels+{+ public interface IHasFolderAttributes+ {+ string[] Attributes { get; }+ }+}\ No newline at end of filediff --git a/MediaBrowser.Controller/Channels/IRequiresMediaInfoCallback.cs b/MediaBrowser.Controller/Channels/IRequiresMediaInfoCallback.csindex 589295543c..eeaa6b622e 100644--- a/MediaBrowser.Controller/Channels/IRequiresMediaInfoCallback.cs+++ b/MediaBrowser.Controller/Channels/IRequiresMediaInfoCallback.cs@@ -1,5 +1,3 @@-#pragma warning disable CS1591-using System.Collections.Generic;using System.Threading;using System.Threading.Tasks;@@ -7,11 +5,17 @@ using MediaBrowser.Model.Dto;namespace MediaBrowser.Controller.Channels{+ /// <summary>+ /// The channel requires a media info callback.+ /// </summary>public interface IRequiresMediaInfoCallback{/// <summary>/// Gets the channel item media information./// </summary>+ /// <param name="id">The channel item id.</param>+ /// <param name="cancellationToken">The cancellation token.</param>+ /// <returns>The enumerable of media source info.</returns>Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaInfo(string id, CancellationToken cancellationToken);}}diff --git a/MediaBrowser.Controller/Channels/ISearchableChannel.cs b/MediaBrowser.Controller/Channels/ISearchableChannel.csindex b58446fc43..b87943a6ed 100644--- a/MediaBrowser.Controller/Channels/ISearchableChannel.cs+++ b/MediaBrowser.Controller/Channels/ISearchableChannel.cs@@ -5,7 +5,6 @@using System.Collections.Generic;using System.Threading;using System.Threading.Tasks;-using MediaBrowser.Controller.Entities;namespace MediaBrowser.Controller.Channels{@@ -19,35 +18,4 @@ namespace MediaBrowser.Controller.Channels/// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>Task<IEnumerable<ChannelItemInfo>> Search(ChannelSearchInfo searchInfo, CancellationToken cancellationToken);}-- public interface ISupportsLatestMedia- {- /// <summary>- /// Gets the latest media.- /// </summary>- /// <param name="request">The request.</param>- /// <param name="cancellationToken">The cancellation token.</param>- /// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>- Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken);- }-- public interface ISupportsDelete- {- bool CanDelete(BaseItem item);-- Task DeleteItem(string id, CancellationToken cancellationToken);- }-- public interface IDisableMediaSourceDisplay- {- }-- public interface ISupportsMediaProbe- {- }-- public interface IHasFolderAttributes- {- string[] Attributes { get; }- }}diff --git a/MediaBrowser.Controller/Channels/ISupportsDelete.cs b/MediaBrowser.Controller/Channels/ISupportsDelete.csnew file mode 100644index 0000000000..d7234fa38f--- /dev/null+++ b/MediaBrowser.Controller/Channels/ISupportsDelete.cs@@ -0,0 +1,17 @@+#nullable disable++#pragma warning disable CS1591++using System.Threading;+using System.Threading.Tasks;+using MediaBrowser.Controller.Entities;++namespace MediaBrowser.Controller.Channels+{+ public interface ISupportsDelete+ {+ bool CanDelete(BaseItem item);++ Task DeleteItem(string id, CancellationToken cancellationToken);+ }+}\ No newline at end of filediff --git a/MediaBrowser.Controller/Channels/ISupportsLatestMedia.cs b/MediaBrowser.Controller/Channels/ISupportsLatestMedia.csnew file mode 100644index 0000000000..6820d9222c--- /dev/null+++ b/MediaBrowser.Controller/Channels/ISupportsLatestMedia.cs@@ -0,0 +1,21 @@+#nullable disable++#pragma warning disable CS1591++using System.Collections.Generic;+using System.Threading;+using System.Threading.Tasks;++namespace MediaBrowser.Controller.Channels+{+ public interface ISupportsLatestMedia+ {+ /// <summary>+ /// Gets the latest media.+ /// </summary>+ /// <param name="request">The request.</param>+ /// <param name="cancellationToken">The cancellation token.</param>+ /// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>+ Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken);+ }+}\ No newline at end of filediff --git a/MediaBrowser.Controller/Channels/ISupportsMediaProbe.cs b/MediaBrowser.Controller/Channels/ISupportsMediaProbe.csnew file mode 100644index 0000000000..2682de51c4--- /dev/null+++ b/MediaBrowser.Controller/Channels/ISupportsMediaProbe.cs@@ -0,0 +1,8 @@+#pragma warning disable CS1591++namespace MediaBrowser.Controller.Channels+{+ public interface ISupportsMediaProbe+ {+ }+}\ No newline at end of filediff --git a/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs b/MediaBrowser.Controller/Channels/InternalChannelFeatures.csindex 152c653dc4..45cd08173a 100644--- a/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs+++ b/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs@@ -30,7 +30,7 @@ namespace MediaBrowser.Controller.Channelspublic List<ChannelMediaContentType> ContentTypes { get; set; }/// <summary>- /// Represents the maximum number of records the channel allows retrieving at a time.+ /// Gets or sets the maximum number of records the channel allows retrieving at a time./// </summary>public int? MaxPageSize { get; set; }@@ -41,7 +41,7 @@ namespace MediaBrowser.Controller.Channelspublic List<ChannelItemSortField> DefaultSortFields { get; set; }/// <summary>- /// Indicates if a sort ascending/descending toggle is supported or not.+ /// Gets or sets a value indicating whether a sort ascending/descending toggle is supported or not./// </summary>public bool SupportsSortOrderToggle { get; set; }diff --git a/MediaBrowser.Controller/Devices/IDeviceManager.cs b/MediaBrowser.Controller/Devices/IDeviceManager.csindex ef17c8fb37..8096be1bd3 100644--- a/MediaBrowser.Controller/Devices/IDeviceManager.cs+++ b/MediaBrowser.Controller/Devices/IDeviceManager.cs@@ -20,7 +20,6 @@ namespace MediaBrowser.Controller.Devices/// </summary>/// <param name="reportedId">The reported identifier.</param>/// <param name="capabilities">The capabilities.</param>- /// <returns>Task.</returns>void SaveCapabilities(string reportedId, ClientCapabilities capabilities);/// <summary>@@ -47,6 +46,9 @@ namespace MediaBrowser.Controller.Devices/// <summary>/// Determines whether this instance [can access device] the specified user identifier./// </summary>+ /// <param name="user">The user to test.</param>+ /// <param name="deviceId">The device id to test.</param>+ /// <returns>Whether the user can access the device.</returns>bool CanAccessDevice(User user, string deviceId);void UpdateDeviceOptions(string deviceId, DeviceOptions options);diff --git a/MediaBrowser.Controller/Dto/IDtoService.cs b/MediaBrowser.Controller/Dto/IDtoService.csindex 7f4bbead0f..e0950b1f61 100644--- a/MediaBrowser.Controller/Dto/IDtoService.cs+++ b/MediaBrowser.Controller/Dto/IDtoService.cs@@ -36,11 +36,17 @@ namespace MediaBrowser.Controller.Dto/// <param name="options">The options.</param>/// <param name="user">The user.</param>/// <param name="owner">The owner.</param>+ /// <returns>The <see cref="IReadOnlyList{T}"/> of <see cref="BaseItemDto"/>.</returns>IReadOnlyList<BaseItemDto> GetBaseItemDtos(IReadOnlyList<BaseItem> items, DtoOptions options, User user = null, BaseItem owner = null);/// <summary>/// Gets the item by name dto./// </summary>+ /// <param name="item">The item.</param>+ /// <param name="options">The dto options.</param>+ /// <param name="taggedItems">The list of tagged items.</param>+ /// <param name="user">The user.</param>+ /// <returns>The <see cref="BaseItemDto"/>.</returns>BaseItemDto GetItemByNameDto(BaseItem item, DtoOptions options, List<BaseItem> taggedItems, User user = null);}}diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.csindex e365bfda1f..533130fc8e 100644--- a/MediaBrowser.Controller/Entities/AggregateFolder.cs+++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs@@ -22,6 +22,8 @@ namespace MediaBrowser.Controller.Entities/// </summary>public class AggregateFolder : Folder{+ private bool _requiresRefresh;+public AggregateFolder(){PhysicalLocationsList = Array.Empty<string>();@@ -85,8 +87,6 @@ namespace MediaBrowser.Controller.Entities}}- private bool _requiresRefresh;-public override bool RequiresRefresh(){var changed = base.RequiresRefresh() || _requiresRefresh;@@ -106,11 +106,11 @@ namespace MediaBrowser.Controller.Entitiesreturn changed;}- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){ClearCache();- var changed = base.BeforeMetadataRefresh(replaceAllMetdata) || _requiresRefresh;+ var changed = base.BeforeMetadataRefresh(replaceAllMetadata) || _requiresRefresh;_requiresRefresh = false;return changed;}diff --git a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs b/MediaBrowser.Controller/Entities/Audio/MusicArtist.csindex b07c3eed13..0928a8073b 100644--- a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs+++ b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs@@ -208,9 +208,9 @@ namespace MediaBrowser.Controller.Entities.Audio/// <summary>/// This is called before any metadata refresh and returns true or false indicating if changes were made./// </summary>- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){- var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);+ var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);if (IsAccessedByName){diff --git a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs b/MediaBrowser.Controller/Entities/Audio/MusicGenre.csindex b07d47ffdd..a682a2e58c 100644--- a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs+++ b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs@@ -38,7 +38,7 @@ namespace MediaBrowser.Controller.Entities.Audiopublic override bool IsDisplayedAsFolder => true;/// <summary>- /// Returns the folder containing the item.+ /// Gets the folder containing the item./// If the item is a folder, it returns the folder itself./// </summary>/// <value>The containing folder path.</value>@@ -106,9 +106,9 @@ namespace MediaBrowser.Controller.Entities.Audio/// <summary>/// This is called before any metadata refresh and returns true or false indicating if changes were made./// </summary>- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){- var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);+ var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);var newPath = GetRebasedPath();if (!string.Equals(Path, newPath, StringComparison.Ordinal))diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.csindex 238c98982c..6e46b4cec8 100644--- a/MediaBrowser.Controller/Entities/BaseItem.cs+++ b/MediaBrowser.Controller/Entities/BaseItem.cs@@ -92,7 +92,8 @@ namespace MediaBrowser.Controller.Entitiespublic const string ShortsFolderName = "shorts";public const string FeaturettesFolderName = "featurettes";- public static readonly string[] AllExtrasTypesFolderNames = {+ public static readonly string[] AllExtrasTypesFolderNames =+ {ExtrasFolderName,BehindTheScenesFolderName,DeletedScenesFolderName,@@ -177,7 +178,7 @@ namespace MediaBrowser.Controller.Entitiespublic virtual bool AlwaysScanInternalMetadataPath => false;/// <summary>- /// Gets a value indicating whether this instance is in mixed folder.+ /// Gets or sets a value indicating whether this instance is in mixed folder./// </summary>/// <value><c>true</c> if this instance is in mixed folder; otherwise, <c>false</c>.</value>[JsonIgnore]@@ -244,7 +245,7 @@ namespace MediaBrowser.Controller.Entitiespublic ProgramAudio? Audio { get; set; }/// <summary>- /// Return the id that should be used to key display prefs for this item.+ /// Gets the id that should be used to key display prefs for this item./// Default is based on the type for everything except actual generic folders./// </summary>/// <value>The display prefs id.</value>@@ -280,7 +281,7 @@ namespace MediaBrowser.Controller.Entities}/// <summary>- /// Returns the folder containing the item.+ /// Gets the folder containing the item./// If the item is a folder, it returns the folder itself./// </summary>[JsonIgnore]@@ -305,8 +306,11 @@ namespace MediaBrowser.Controller.Entitiespublic string ServiceName { get; set; }/// <summary>- /// If this content came from an external service, the id of the content on that service.+ /// Gets or sets the external id./// </summary>+ /// <remarks>+ /// If this content came from an external service, the id of the content on that service.+ /// </remarks>[JsonIgnore]public string ExternalId { get; set; }@@ -330,7 +334,7 @@ namespace MediaBrowser.Controller.Entities}/// <summary>- /// Gets or sets the type of the location.+ /// Gets the type of the location./// </summary>/// <value>The type of the location.</value>[JsonIgnore]@@ -449,8 +453,11 @@ namespace MediaBrowser.Controller.Entities}/// <summary>- /// This is just a helper for convenience.+ /// Gets the primary image path./// </summary>+ /// <remarks>+ /// This is just a helper for convenience.+ /// </remarks>/// <value>The primary image path.</value>[JsonIgnore]public string PrimaryImagePath => this.GetImagePath(ImageType.Primary);@@ -541,7 +548,7 @@ namespace MediaBrowser.Controller.Entitiespublic DateTime DateLastRefreshed { get; set; }/// <summary>- /// The logger.+ /// Gets or sets the logger./// </summary>public static ILogger<BaseItem> Logger { get; set; }@@ -621,7 +628,7 @@ namespace MediaBrowser.Controller.Entitiesprivate Guid[] _themeVideoIds;/// <summary>- /// Gets the name of the sort.+ /// Gets or sets the name of the sort./// </summary>/// <value>The name of the sort.</value>[JsonIgnore]@@ -848,7 +855,7 @@ namespace MediaBrowser.Controller.Entities}/// <summary>- /// When the item first debuted. For movies this could be premiere date, episodes would be first aired+ /// Gets or sets the date that the item first debuted. For movies this could be premiere date, episodes would be first aired./// </summary>/// <value>The premiere date.</value>[JsonIgnore]@@ -945,7 +952,7 @@ namespace MediaBrowser.Controller.Entitiespublic int? ProductionYear { get; set; }/// <summary>- /// If the item is part of a series, this is it's number in the series.+ /// Gets or sets the index number. If the item is part of a series, this is it's number in the series./// This could be episode number, album track number, etc./// </summary>/// <value>The index number.</value>@@ -953,7 +960,7 @@ namespace MediaBrowser.Controller.Entitiespublic int? IndexNumber { get; set; }/// <summary>- /// For an episode this could be the season number, or for a song this could be the disc number.+ /// Gets or sets the parent index number. For an episode this could be the season number, or for a song this could be the disc number./// </summary>/// <value>The parent index number.</value>[JsonIgnore]@@ -1017,9 +1024,9 @@ namespace MediaBrowser.Controller.Entities}// if (!user.IsParentalScheduleAllowed())- //{+ // {// return PlayAccess.None;- //}+ // }return PlayAccess.Full;}@@ -2645,7 +2652,9 @@ namespace MediaBrowser.Controller.Entities/// <summary>/// This is called before any metadata refresh and returns true if changes were made./// </summary>- public virtual bool BeforeMetadataRefresh(bool replaceAllMetdata)+ /// <param name="replaceAllMetadata">Whether to replace all metadata.</param>+ /// <returns>true if the item has change, else false.</returns>+ public virtual bool BeforeMetadataRefresh(bool replaceAllMetadata){_sortName = null;diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.csindex a86da29ce4..d0fb3997d5 100644--- a/MediaBrowser.Controller/Entities/CollectionFolder.cs+++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs@@ -29,30 +29,45 @@ namespace MediaBrowser.Controller.Entitiespublic class CollectionFolder : Folder, ICollectionFolder{private static readonly JsonSerializerOptions _jsonOptions = JsonDefaults.Options;- public static IXmlSerializer XmlSerializer { get; set; }-- public static IServerApplicationHost ApplicationHost { get; set; }+ private static readonly Dictionary<string, LibraryOptions> _libraryOptions = new Dictionary<string, LibraryOptions>();+ private bool _requiresRefresh;+ /// <summary>+ /// Initializes a new instance of the <see cref="CollectionFolder"/> class.+ /// </summary>public CollectionFolder(){PhysicalLocationsList = Array.Empty<string>();PhysicalFolderIds = Array.Empty<Guid>();}+ public static IXmlSerializer XmlSerializer { get; set; }++ public static IServerApplicationHost ApplicationHost { get; set; }+[JsonIgnore]public override bool SupportsPlayedStatus => false;[JsonIgnore]public override bool SupportsInheritedParentImages => false;+ public string CollectionType { get; set; }++ /// <summary>+ /// Gets the item's children.+ /// </summary>+ /// <remarks>+ /// Our children are actually just references to the ones in the physical root...+ /// </remarks>+ /// <value>The actual children.</value>+ [JsonIgnore]+ public override IEnumerable<BaseItem> Children => GetActualChildren();+public override bool CanDelete(){return false;}- public string CollectionType { get; set; }-- private static readonly Dictionary<string, LibraryOptions> LibraryOptions = new Dictionary<string, LibraryOptions>();public LibraryOptions GetLibraryOptions(){return GetLibraryOptions(Path);@@ -106,12 +121,12 @@ namespace MediaBrowser.Controller.Entitiespublic static LibraryOptions GetLibraryOptions(string path){- lock (LibraryOptions)+ lock (_libraryOptions){- if (!LibraryOptions.TryGetValue(path, out var options))+ if (!_libraryOptions.TryGetValue(path, out var options)){options = LoadLibraryOptions(path);- LibraryOptions[path] = options;+ _libraryOptions[path] = options;}return options;@@ -120,9 +135,9 @@ namespace MediaBrowser.Controller.Entitiespublic static void SaveLibraryOptions(string path, LibraryOptions options){- lock (LibraryOptions)+ lock (_libraryOptions){- LibraryOptions[path] = options;+ _libraryOptions[path] = options;var clone = JsonSerializer.Deserialize<LibraryOptions>(JsonSerializer.SerializeToUtf8Bytes(options, _jsonOptions), _jsonOptions);foreach (var mediaPath in clone.PathInfos)@@ -139,15 +154,18 @@ namespace MediaBrowser.Controller.Entitiespublic static void OnCollectionFolderChange(){- lock (LibraryOptions)+ lock (_libraryOptions){- LibraryOptions.Clear();+ _libraryOptions.Clear();}}/// <summary>- /// Allow different display preferences for each collection folder.+ /// Gets the display preferences id./// </summary>+ /// <remarks>+ /// Allow different display preferences for each collection folder.+ /// </remarks>/// <value>The display prefs id.</value>[JsonIgnore]public override Guid DisplayPreferencesId => Id;@@ -155,21 +173,20 @@ namespace MediaBrowser.Controller.Entities[JsonIgnore]public override string[] PhysicalLocations => PhysicalLocationsList;+ public string[] PhysicalLocationsList { get; set; }++ public Guid[] PhysicalFolderIds { get; set; }+public override bool IsSaveLocalMetadataEnabled(){return true;}- public string[] PhysicalLocationsList { get; set; }-- public Guid[] PhysicalFolderIds { get; set; }-protected override FileSystemMetadata[] GetFileSystemChildren(IDirectoryService directoryService){return CreateResolveArgs(directoryService, true).FileSystemChildren;}- private bool _requiresRefresh;public override bool RequiresRefresh(){var changed = base.RequiresRefresh() || _requiresRefresh;@@ -201,9 +218,9 @@ namespace MediaBrowser.Controller.Entitiesreturn changed;}- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){- var changed = base.BeforeMetadataRefresh(replaceAllMetdata) || _requiresRefresh;+ var changed = base.BeforeMetadataRefresh(replaceAllMetadata) || _requiresRefresh;_requiresRefresh = false;return changed;}@@ -312,13 +329,6 @@ namespace MediaBrowser.Controller.Entitiesreturn Task.CompletedTask;}- /// <summary>- /// Our children are actually just references to the ones in the physical root...- /// </summary>- /// <value>The actual children.</value>- [JsonIgnore]- public override IEnumerable<BaseItem> Children => GetActualChildren();-public IEnumerable<BaseItem> GetActualChildren(){return GetPhysicalFolders(true).SelectMany(c => c.Children);diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.csindex a59f5c6e4b..29d837c143 100644--- a/MediaBrowser.Controller/Entities/Folder.cs+++ b/MediaBrowser.Controller/Entities/Folder.cs@@ -37,6 +37,11 @@ namespace MediaBrowser.Controller.Entities/// </summary>public class Folder : BaseItem{+ public Folder()+ {+ LinkedChildren = Array.Empty<LinkedChild>();+ }+public static IUserViewManager UserViewManager { get; set; }/// <summary>@@ -50,11 +55,6 @@ namespace MediaBrowser.Controller.Entities[JsonIgnore]public DateTime? DateLastMediaAdded { get; set; }- public Folder()- {- LinkedChildren = Array.Empty<LinkedChild>();- }-[JsonIgnore]public override bool SupportsThemeMedia => true;@@ -86,6 +86,85 @@ namespace MediaBrowser.Controller.Entities[JsonIgnore]public virtual bool SupportsDateLastMediaAdded => false;+ [JsonIgnore]+ public override string FileNameWithoutExtension+ {+ get+ {+ if (IsFileProtocol)+ {+ return System.IO.Path.GetFileName(Path);+ }++ return null;+ }+ }++ /// <summary>+ /// Gets the actual children.+ /// </summary>+ /// <value>The actual children.</value>+ [JsonIgnore]+ public virtual IEnumerable<BaseItem> Children => LoadChildren();++ /// <summary>+ /// Gets thread-safe access to all recursive children of this folder - without regard to user.+ /// </summary>+ /// <value>The recursive children.</value>+ [JsonIgnore]+ public IEnumerable<BaseItem> RecursiveChildren => GetRecursiveChildren();++ [JsonIgnore]+ protected virtual bool SupportsShortcutChildren => false;++ protected virtual bool FilterLinkedChildrenPerUser => false;++ [JsonIgnore]+ protected override bool SupportsOwnedItems => base.SupportsOwnedItems || SupportsShortcutChildren;++ [JsonIgnore]+ public virtual bool SupportsUserDataFromChildren+ {+ get+ {+ // These are just far too slow.+ if (this is ICollectionFolder)+ {+ return false;+ }++ if (this is UserView)+ {+ return false;+ }++ if (this is UserRootFolder)+ {+ return false;+ }++ if (this is Channel)+ {+ return false;+ }++ if (SourceType != SourceType.Library)+ {+ return false;+ }++ if (this is IItemByName)+ {+ if (this is not IHasDualAccess hasDualAccess || hasDualAccess.IsAccessedByName)+ {+ return false;+ }+ }++ return true;+ }+ }+public override bool CanDelete(){if (IsRoot)@@ -108,20 +187,6 @@ namespace MediaBrowser.Controller.Entitiesreturn baseResult;}- [JsonIgnore]- public override string FileNameWithoutExtension- {- get- {- if (IsFileProtocol)- {- return System.IO.Path.GetFileName(Path);- }-- return null;- }- }-protected override bool IsAllowTagFilterEnforced(){if (this is ICollectionFolder)@@ -137,9 +202,6 @@ namespace MediaBrowser.Controller.Entitiesreturn true;}- [JsonIgnore]- protected virtual bool SupportsShortcutChildren => false;-/// <summary>/// Adds the child./// </summary>@@ -169,20 +231,6 @@ namespace MediaBrowser.Controller.EntitiesLibraryManager.CreateItem(item, this);}- /// <summary>- /// Gets the actual children.- /// </summary>- /// <value>The actual children.</value>- [JsonIgnore]- public virtual IEnumerable<BaseItem> Children => LoadChildren();-- /// <summary>- /// thread-safe access to all recursive children of this folder - without regard to user.- /// </summary>- /// <value>The recursive children.</value>- [JsonIgnore]- public IEnumerable<BaseItem> RecursiveChildren => GetRecursiveChildren();-public override bool IsVisible(User user){if (this is ICollectionFolder && !(this is BasePluginFolder))@@ -1428,8 +1476,6 @@ namespace MediaBrowser.Controller.Entitiesreturn list;}- protected virtual bool FilterLinkedChildrenPerUser => false;-public bool ContainsLinkedChildByItemId(Guid itemId){var linkedChildren = LinkedChildren;@@ -1530,9 +1576,6 @@ namespace MediaBrowser.Controller.Entities.Where(i => i.Item2 != null);}- [JsonIgnore]- protected override bool SupportsOwnedItems => base.SupportsOwnedItems || SupportsShortcutChildren;-protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken){var changesFound = false;@@ -1696,51 +1739,6 @@ namespace MediaBrowser.Controller.Entitiesreturn !IsPlayed(user);}- [JsonIgnore]- public virtual bool SupportsUserDataFromChildren- {- get- {- // These are just far too slow.- if (this is ICollectionFolder)- {- return false;- }-- if (this is UserView)- {- return false;- }-- if (this is UserRootFolder)- {- return false;- }-- if (this is Channel)- {- return false;- }-- if (SourceType != SourceType.Library)- {- return false;- }-- var iItemByName = this as IItemByName;- if (iItemByName != null)- {- var hasDualAccess = this as IHasDualAccess;- if (hasDualAccess == null || hasDualAccess.IsAccessedByName)- {- return false;- }- }-- return true;- }- }-public override void FillUserDataDtoValues(UserItemDataDto dto, UserItemData userData, BaseItemDto itemDto, User user, DtoOptions fields){if (!SupportsUserDataFromChildren)diff --git a/MediaBrowser.Controller/Entities/Genre.cs b/MediaBrowser.Controller/Entities/Genre.csindex 310c0c9ec7..698643b446 100644--- a/MediaBrowser.Controller/Entities/Genre.cs+++ b/MediaBrowser.Controller/Entities/Genre.cs@@ -16,6 +16,23 @@ namespace MediaBrowser.Controller.Entities/// </summary>public class Genre : BaseItem, IItemByName{+ /// <summary>+ /// Gets the folder containing the item.+ /// If the item is a folder, it returns the folder itself.+ /// </summary>+ /// <value>The containing folder path.</value>+ [JsonIgnore]+ public override string ContainingFolderPath => Path;++ [JsonIgnore]+ public override bool IsDisplayedAsFolder => true;++ [JsonIgnore]+ public override bool SupportsAncestors => false;++ [JsonIgnore]+ public override bool SupportsPeople => false;+public override List<string> GetUserDataKeys(){var list = base.GetUserDataKeys();@@ -34,20 +51,6 @@ namespace MediaBrowser.Controller.Entitiesreturn 1;}- /// <summary>- /// Gets the folder containing the item.- /// If the item is a folder, it returns the folder itself.- /// </summary>- /// <value>The containing folder path.</value>- [JsonIgnore]- public override string ContainingFolderPath => Path;-- [JsonIgnore]- public override bool IsDisplayedAsFolder => true;-- [JsonIgnore]- public override bool SupportsAncestors => false;-public override bool IsSaveLocalMetadataEnabled(){return true;@@ -72,9 +75,6 @@ namespace MediaBrowser.Controller.Entitiesreturn LibraryManager.GetItemList(query);}- [JsonIgnore]- public override bool SupportsPeople => false;-public static string GetPath(string name){return GetPath(name, true);@@ -107,12 +107,10 @@ namespace MediaBrowser.Controller.Entitiesreturn base.RequiresRefresh();}- /// <summary>- /// This is called before any metadata refresh and returns true or false indicating if changes were made.- /// </summary>- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ /// <inheridoc />+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){- var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);+ var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);var newPath = GetRebasedPath();if (!string.Equals(Path, newPath, StringComparison.Ordinal))diff --git a/MediaBrowser.Controller/Entities/IHasSeries.cs b/MediaBrowser.Controller/Entities/IHasSeries.csindex 64d769d5ba..5f774bbdee 100644--- a/MediaBrowser.Controller/Entities/IHasSeries.cs+++ b/MediaBrowser.Controller/Entities/IHasSeries.cs@@ -9,7 +9,7 @@ namespace MediaBrowser.Controller.Entitiespublic interface IHasSeries{/// <summary>- /// Gets the name of the series.+ /// Gets or sets the name of the series./// </summary>/// <value>The name of the series.</value>string SeriesName { get; set; }diff --git a/MediaBrowser.Controller/Entities/IHasShares.cs b/MediaBrowser.Controller/Entities/IHasShares.csnew file mode 100644index 0000000000..bdde744a37--- /dev/null+++ b/MediaBrowser.Controller/Entities/IHasShares.cs@@ -0,0 +1,11 @@+#nullable disable++#pragma warning disable CS1591++namespace MediaBrowser.Controller.Entities+{+ public interface IHasShares+ {+ Share[] Shares { get; set; }+ }+}\ No newline at end of filediff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.csindex 64d60c2e90..b54bbf5eb9 100644--- a/MediaBrowser.Controller/Entities/Movies/Movie.cs+++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs@@ -144,9 +144,9 @@ namespace MediaBrowser.Controller.Entities.Movies}/// <inheritdoc />- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){- var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);+ var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);if (!ProductionYear.HasValue){diff --git a/MediaBrowser.Controller/Entities/MusicVideo.cs b/MediaBrowser.Controller/Entities/MusicVideo.csindex 4e622ba01b..237ad5198c 100644--- a/MediaBrowser.Controller/Entities/MusicVideo.cs+++ b/MediaBrowser.Controller/Entities/MusicVideo.cs@@ -36,9 +36,9 @@ namespace MediaBrowser.Controller.Entitiesreturn info;}- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){- var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);+ var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);if (!ProductionYear.HasValue){diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.csindex d9ff55362c..913f76d3bd 100644--- a/MediaBrowser.Controller/Entities/Person.cs+++ b/MediaBrowser.Controller/Entities/Person.cs@@ -50,7 +50,7 @@ namespace MediaBrowser.Controller.Entities}/// <summary>- /// Returns the folder containing the item.+ /// Gets the folder containing the item./// If the item is a folder, it returns the folder itself./// </summary>/// <value>The containing folder path.</value>@@ -67,6 +67,9 @@ namespace MediaBrowser.Controller.Entitiesreturn true;}+ /// <summary>+ /// Gets a value indicating whether to enable alpha numeric sorting.+ /// </summary>[JsonIgnore]public override bool EnableAlphaNumericSorting => false;@@ -126,9 +129,9 @@ namespace MediaBrowser.Controller.Entities/// <summary>/// This is called before any metadata refresh and returns true or false indicating if changes were made./// </summary>- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){- var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);+ var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);var newPath = GetRebasedPath();if (!string.Equals(Path, newPath, StringComparison.Ordinal))diff --git a/MediaBrowser.Controller/Entities/Share.cs b/MediaBrowser.Controller/Entities/Share.csindex 7e4ec18307..64f446eef2 100644--- a/MediaBrowser.Controller/Entities/Share.cs+++ b/MediaBrowser.Controller/Entities/Share.cs@@ -4,11 +4,6 @@namespace MediaBrowser.Controller.Entities{- public interface IHasShares- {- Share[] Shares { get; set; }- }-public class Share{public string UserId { get; set; }diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.csindex ae1d10447b..6fd0a6c6c3 100644--- a/MediaBrowser.Controller/Entities/Studio.cs+++ b/MediaBrowser.Controller/Entities/Studio.cs@@ -29,7 +29,7 @@ namespace MediaBrowser.Controller.Entities}/// <summary>- /// Returns the folder containing the item.+ /// Gets the folder containing the item./// If the item is a folder, it returns the folder itself./// </summary>/// <value>The containing folder path.</value>@@ -105,9 +105,9 @@ namespace MediaBrowser.Controller.Entities/// <summary>/// This is called before any metadata refresh and returns true or false indicating if changes were made./// </summary>- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){- var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);+ var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);var newPath = GetRebasedPath();if (!string.Equals(Path, newPath, StringComparison.Ordinal))diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.csindex 2724bd9b3d..1b4cc7a78b 100644--- a/MediaBrowser.Controller/Entities/TV/Episode.cs+++ b/MediaBrowser.Controller/Entities/TV/Episode.cs@@ -34,7 +34,7 @@ namespace MediaBrowser.Controller.Entities.TVpublic IReadOnlyList<Guid> RemoteTrailerIds { get; set; }/// <summary>- /// Gets the season in which it aired.+ /// Gets or sets the season in which it aired./// </summary>/// <value>The aired season.</value>public int? AirsBeforeSeasonNumber { get; set; }@@ -44,7 +44,7 @@ namespace MediaBrowser.Controller.Entities.TVpublic int? AirsBeforeEpisodeNumber { get; set; }/// <summary>- /// This is the ending episode number for double episodes.+ /// Gets or sets the ending episode number for double episodes./// </summary>/// <value>The index number.</value>public int? IndexNumberEnd { get; set; }@@ -116,7 +116,7 @@ namespace MediaBrowser.Controller.Entities.TV}/// <summary>- /// This Episode's Series Instance.+ /// Gets the Episode's Series Instance./// </summary>/// <value>The series.</value>[JsonIgnore]@@ -261,6 +261,7 @@ namespace MediaBrowser.Controller.Entities.TV[JsonIgnore]public Guid SeasonId { get; set; }+[JsonIgnore]public Guid SeriesId { get; set; }@@ -318,9 +319,9 @@ namespace MediaBrowser.Controller.Entities.TVreturn id;}- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){- var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);+ var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);if (!IsLocked){@@ -328,7 +329,7 @@ namespace MediaBrowser.Controller.Entities.TV{try{- if (LibraryManager.FillMissingEpisodeNumbersFromPath(this, replaceAllMetdata))+ if (LibraryManager.FillMissingEpisodeNumbersFromPath(this, replaceAllMetadata)){hasChanges = true;}diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.csindex ad3e0fe8d6..5e2053dcc7 100644--- a/MediaBrowser.Controller/Entities/TV/Season.cs+++ b/MediaBrowser.Controller/Entities/TV/Season.cs@@ -81,7 +81,7 @@ namespace MediaBrowser.Controller.Entities.TV}/// <summary>- /// This Episode's Series Instance.+ /// Gets this Episode's Series Instance./// </summary>/// <value>The series.</value>[JsonIgnore]@@ -242,9 +242,9 @@ namespace MediaBrowser.Controller.Entities.TV/// This is called before any metadata refresh and returns true or false indicating if changes were made./// </summary>/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){- var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);+ var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);if (!IndexNumber.HasValue && !string.IsNullOrEmpty(Path)){diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.csindex ded825abc0..44d07b4a48 100644--- a/MediaBrowser.Controller/Entities/TV/Series.cs+++ b/MediaBrowser.Controller/Entities/TV/Series.cs@@ -59,8 +59,11 @@ namespace MediaBrowser.Controller.Entities.TVpublic IReadOnlyList<Guid> RemoteTrailerIds { get; set; }/// <summary>- /// airdate, dvd or absolute.+ /// Gets or sets the display order./// </summary>+ /// <remarks>+ /// Valid options are airdate, dvd or absolute.+ /// </remarks>public string DisplayOrder { get; set; }/// <summary>diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.csindex b086b5906b..732b45521b 100644--- a/MediaBrowser.Controller/Entities/Trailer.cs+++ b/MediaBrowser.Controller/Entities/Trailer.cs@@ -45,9 +45,9 @@ namespace MediaBrowser.Controller.Entitiesreturn info;}- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){- var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);+ var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);if (!ProductionYear.HasValue){diff --git a/MediaBrowser.Controller/Entities/UserItemData.cs b/MediaBrowser.Controller/Entities/UserItemData.csindex f60359c014..6ab2116d73 100644--- a/MediaBrowser.Controller/Entities/UserItemData.cs+++ b/MediaBrowser.Controller/Entities/UserItemData.cs@@ -96,7 +96,7 @@ namespace MediaBrowser.Controller.Entitiespublic const double MinLikeValue = 6.5;/// <summary>- /// This is an interpreted property to indicate likes or dislikes+ /// Gets or sets a value indicating whether the item is liked or not./// This should never be serialized./// </summary>/// <value><c>null</c> if [likes] contains no value, <c>true</c> if [likes]; otherwise, <c>false</c>.</value>diff --git a/MediaBrowser.Controller/Entities/UserRootFolder.cs b/MediaBrowser.Controller/Entities/UserRootFolder.csindex e492740ed0..2dea2e50bf 100644--- a/MediaBrowser.Controller/Entities/UserRootFolder.cs+++ b/MediaBrowser.Controller/Entities/UserRootFolder.cs@@ -23,6 +23,7 @@ namespace MediaBrowser.Controller.Entities{private List<Guid> _childrenIds = null;private readonly object _childIdsLock = new object();+protected override List<BaseItem> LoadChildren(){lock (_childIdsLock)@@ -87,10 +88,10 @@ namespace MediaBrowser.Controller.Entitiesreturn list;}- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){ClearCache();- var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);+ var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);if (string.Equals("default", Name, StringComparison.OrdinalIgnoreCase)){diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.csindex 0dfde27667..1e6c01bf8b 100644--- a/MediaBrowser.Controller/Entities/UserView.cs+++ b/MediaBrowser.Controller/Entities/UserView.cs@@ -15,13 +15,19 @@ namespace MediaBrowser.Controller.Entities{public class UserView : Folder, IHasCollectionType{- /// <inheritdoc />+ /// <summary>+ /// Gets or sets the view type.+ /// </summary>public string ViewType { get; set; }- /// <inheritdoc />+ /// <summary>+ /// Gets or sets the display parent id.+ /// </summary>public new Guid DisplayParentId { get; set; }- /// <inheritdoc />+ /// <summary>+ /// Gets or sets the user id.+ /// </summary>public Guid? UserId { get; set; }public static ITVSeriesManager TVSeriesManager;@@ -110,10 +116,10 @@ namespace MediaBrowser.Controller.Entitiesreturn GetChildren(user, false);}- private static string[] UserSpecificViewTypes = new string[]- {- Model.Entities.CollectionType.Playlists- };+ private static readonly string[] UserSpecificViewTypes = new string[]+ {+ Model.Entities.CollectionType.Playlists+ };public static bool IsUserSpecific(Folder folder){diff --git a/MediaBrowser.Controller/Entities/Year.cs b/MediaBrowser.Controller/Entities/Year.csindex 4d84a151a7..f268bc939e 100644--- a/MediaBrowser.Controller/Entities/Year.cs+++ b/MediaBrowser.Controller/Entities/Year.cs@@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.Entities}/// <summary>- /// Returns the folder containing the item.+ /// Gets the folder containing the item./// If the item is a folder, it returns the folder itself./// </summary>/// <value>The containing folder path.</value>@@ -112,11 +112,13 @@ namespace MediaBrowser.Controller.Entities}/// <summary>- /// This is called before any metadata refresh and returns true or false indicating if changes were made.+ /// This is called before any metadata refresh and returns true if changes were made./// </summary>- public override bool BeforeMetadataRefresh(bool replaceAllMetdata)+ /// <param name="replaceAllMetadata">Whether to replace all metadata.</param>+ /// <returns>true if the item has change, else false.</returns>+ public override bool BeforeMetadataRefresh(bool replaceAllMetadata){- var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);+ var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);var newPath = GetRebasedPath();if (!string.Equals(Path, newPath, StringComparison.Ordinal))diff --git a/MediaBrowser.Controller/Extensions/StringExtensions.cs b/MediaBrowser.Controller/Extensions/StringExtensions.csindex 8441a31713..48bd9522a8 100644--- a/MediaBrowser.Controller/Extensions/StringExtensions.cs+++ b/MediaBrowser.Controller/Extensions/StringExtensions.cs@@ -33,7 +33,7 @@ namespace MediaBrowser.Controller.Extensions{// will throw if input contains invalid unicode chars// https://mnaoumov.wordpress.com/2014/06/14/stripping-invalid-characters-from-utf-16-strings/- text = Regex.Replace(text, "([\ud800-\udbff](?![\udc00-\udfff]))|((?<![\ud800-\udbff])[\udc00-\udfff])", "");+ text = Regex.Replace(text, "([\ud800-\udbff](?![\udc00-\udfff]))|((?<![\ud800-\udbff])[\udc00-\udfff])", string.Empty);return Normalize(text, form, false);}}diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.csindex 782e153982..ca21569a7e 100644--- a/MediaBrowser.Controller/Library/ILibraryManager.cs+++ b/MediaBrowser.Controller/Library/ILibraryManager.cs@@ -43,6 +43,12 @@ namespace MediaBrowser.Controller.Library/// <summary>/// Resolves a set of files into a list of BaseItem./// </summary>+ /// <param name="files">The list of tiles.</param>+ /// <param name="directoryService">Instance of the <see cref="IDirectoryService"/> interface.</param>+ /// <param name="parent">The parent folder.</param>+ /// <param name="libraryOptions">The library options.</param>+ /// <param name="collectionType">The collection type.</param>+ /// <returns>The list of <see cref="BaseItem"/>.</returns>IEnumerable<BaseItem> ResolvePaths(IEnumerable<FileSystemMetadata> files,IDirectoryService directoryService,diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.csindex 51e56f4b5e..1a893fc2d0 100644--- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs+++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs@@ -148,7 +148,7 @@ namespace MediaBrowser.Controller.LiveTvpublic bool IsNews { get; set; }/// <summary>- /// Gets or sets a value indicating whether this instance is kids.+ /// Gets a value indicating whether this instance is kids./// </summary>/// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>[JsonIgnore]diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.csindex a66bec11cb..e2adec0009 100644--- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs+++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs@@ -71,7 +71,7 @@ namespace MediaBrowser.Controller.LiveTvpublic override SourceType SourceType => SourceType.LiveTV;/// <summary>- /// The start date of the program, in UTC.+ /// Gets or sets start date of the program, in UTC./// </summary>[JsonIgnore]public DateTime StartDate { get; set; }diff --git a/MediaBrowser.Controller/LiveTv/TimerInfo.cs b/MediaBrowser.Controller/LiveTv/TimerInfo.csindex e54dc967ca..1a2e8acb31 100644--- a/MediaBrowser.Controller/LiveTv/TimerInfo.cs+++ b/MediaBrowser.Controller/LiveTv/TimerInfo.cs@@ -28,18 +28,17 @@ namespace MediaBrowser.Controller.LiveTvpublic string[] Tags { get; set; }/// <summary>- /// Id of the recording.+ /// Gets or sets the id of the recording./// </summary>public string Id { get; set; }/// <summary>/// Gets or sets the series timer identifier./// </summary>- /// <value>The series timer identifier.</value>public string SeriesTimerId { get; set; }/// <summary>- /// ChannelId of the recording.+ /// Gets or sets the channelId of the recording./// </summary>public string ChannelId { get; set; }@@ -52,24 +51,24 @@ namespace MediaBrowser.Controller.LiveTvpublic string ShowId { get; set; }/// <summary>- /// Name of the recording.+ /// Gets or sets the name of the recording./// </summary>public string Name { get; set; }/// <summary>- /// Description of the recording.+ /// Gets or sets the description of the recording./// </summary>public string Overview { get; set; }public string SeriesId { get; set; }/// <summary>- /// The start date of the recording, in UTC.+ /// Gets or sets the start date of the recording, in UTC./// </summary>public DateTime StartDate { get; set; }/// <summary>- /// The end date of the recording, in UTC.+ /// Gets or sets the end date of the recording, in UTC./// </summary>public DateTime EndDate { get; set; }@@ -133,7 +132,7 @@ namespace MediaBrowser.Controller.LiveTvpublic bool IsSeries { get; set; }/// <summary>- /// Gets or sets a value indicating whether this instance is live.+ /// Gets a value indicating whether this instance is live./// </summary>/// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>[JsonIgnore]diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.csindex 97cb8d63ba..9300fd49a1 100644--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs@@ -2933,6 +2933,7 @@ namespace MediaBrowser.Controller.MediaEncodingreturn threads;}+#nullable disablepublic void TryStreamCopy(EncodingJobInfo state){diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.csindex 1e13382b75..bc34785eeb 100644--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs@@ -430,7 +430,7 @@ namespace MediaBrowser.Controller.MediaEncoding}/// <summary>- /// Predicts the audio sample rate that will be in the output stream.+ /// Gets the target video level./// </summary>public double? TargetVideoLevel{@@ -453,7 +453,7 @@ namespace MediaBrowser.Controller.MediaEncoding}/// <summary>- /// Predicts the audio sample rate that will be in the output stream.+ /// Gets the target video bit depth./// </summary>public int? TargetVideoBitDepth{@@ -488,7 +488,7 @@ namespace MediaBrowser.Controller.MediaEncoding}/// <summary>- /// Predicts the audio sample rate that will be in the output stream.+ /// Gets the target framerate./// </summary>public float? TargetFramerate{@@ -520,7 +520,7 @@ namespace MediaBrowser.Controller.MediaEncoding}/// <summary>- /// Predicts the audio sample rate that will be in the output stream.+ /// Gets the target packet length./// </summary>public int? TargetPacketLength{@@ -536,7 +536,7 @@ namespace MediaBrowser.Controller.MediaEncoding}/// <summary>- /// Predicts the audio sample rate that will be in the output stream.+ /// Gets the target video profile./// </summary>public string TargetVideoProfile{@@ -700,25 +700,4 @@ namespace MediaBrowser.Controller.MediaEncodingProgress.Report(percentComplete.Value);}}-- /// <summary>- /// Enum TranscodingJobType.- /// </summary>- public enum TranscodingJobType- {- /// <summary>- /// The progressive.- /// </summary>- Progressive,-- /// <summary>- /// The HLS.- /// </summary>- Hls,-- /// <summary>- /// The dash.- /// </summary>- Dash- }}diff --git a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.csindex d3260280a5..76a9fd7c74 100644--- a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs+++ b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs@@ -20,7 +20,7 @@ namespace MediaBrowser.Controller.MediaEncodingpublic interface IMediaEncoder : ITranscoderSupport{/// <summary>- /// The location of the discovered FFmpeg tool.+ /// Gets location of the discovered FFmpeg tool./// </summary>FFmpegLocation EncoderLocation { get; }diff --git a/MediaBrowser.Controller/MediaEncoding/TranscodingJobType.cs b/MediaBrowser.Controller/MediaEncoding/TranscodingJobType.csnew file mode 100644index 0000000000..66b6283719--- /dev/null+++ b/MediaBrowser.Controller/MediaEncoding/TranscodingJobType.cs@@ -0,0 +1,23 @@+namespace MediaBrowser.Controller.MediaEncoding+{+ /// <summary>+ /// Enum TranscodingJobType.+ /// </summary>+ public enum TranscodingJobType+ {+ /// <summary>+ /// The progressive.+ /// </summary>+ Progressive,++ /// <summary>+ /// The HLS.+ /// </summary>+ Hls,++ /// <summary>+ /// The dash.+ /// </summary>+ Dash+ }+}\ No newline at end of filediff --git a/MediaBrowser.Controller/Playlists/Playlist.cs b/MediaBrowser.Controller/Playlists/Playlist.csindex a80c116439..f767c2c2b4 100644--- a/MediaBrowser.Controller/Playlists/Playlist.cs+++ b/MediaBrowser.Controller/Playlists/Playlist.cs@@ -22,7 +22,8 @@ namespace MediaBrowser.Controller.Playlists{public class Playlist : Folder, IHasShares{- public static string[] SupportedExtensions =+ public static readonly IReadOnlyList<string> SupportedExtensions =+ new[]{".m3u",".m3u8",diff --git a/MediaBrowser.Controller/Plugins/IRunBeforeStartup.cs b/MediaBrowser.Controller/Plugins/IRunBeforeStartup.csnew file mode 100644index 0000000000..ea966c2827--- /dev/null+++ b/MediaBrowser.Controller/Plugins/IRunBeforeStartup.cs@@ -0,0 +1,9 @@+namespace MediaBrowser.Controller.Plugins+{+ /// <summary>+ /// Indicates that a <see cref="IServerEntryPoint"/> should be invoked as a pre-startup task.+ /// </summary>+ public interface IRunBeforeStartup+ {+ }+}\ No newline at end of filediff --git a/MediaBrowser.Controller/Plugins/IServerEntryPoint.cs b/MediaBrowser.Controller/Plugins/IServerEntryPoint.csindex b44e2531e1..6024661e15 100644--- a/MediaBrowser.Controller/Plugins/IServerEntryPoint.cs+++ b/MediaBrowser.Controller/Plugins/IServerEntryPoint.cs@@ -14,13 +14,7 @@ namespace MediaBrowser.Controller.Plugins/// <summary>/// Run the initialization for this module. This method is invoked at application start./// </summary>+ /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>Task RunAsync();}-- /// <summary>- /// Indicates that a <see cref="IServerEntryPoint"/> should be invoked as a pre-startup task.- /// </summary>- public interface IRunBeforeStartup- {- }}diff --git a/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs b/MediaBrowser.Controller/Providers/MetadataRefreshOptions.csindex 1152504669..2cf5367793 100644--- a/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs+++ b/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs@@ -40,7 +40,7 @@ namespace MediaBrowser.Controller.Providers/// <summary>/// Gets or sets a value indicating whether all existing data should be overwritten with new data from providers- /// when paired with MetadataRefreshMode=FullRefresh+ /// when paired with MetadataRefreshMode=FullRefresh./// </summary>public bool ReplaceAllMetadata { get; set; }diff --git a/MediaBrowser.Controller/Sync/IHasDynamicAccess.cs b/MediaBrowser.Controller/Sync/IHasDynamicAccess.csdeleted file mode 100644index 3d3e44da01..0000000000--- a/MediaBrowser.Controller/Sync/IHasDynamicAccess.cs+++ /dev/null@@ -1,22 +0,0 @@-#nullable disable--#pragma warning disable CS1591--using System.Threading;-using System.Threading.Tasks;-using MediaBrowser.Model.Sync;--namespace MediaBrowser.Controller.Sync-{- public interface IHasDynamicAccess- {- /// <summary>- /// Gets the synced file information.- /// </summary>- /// <param name="id">The identifier.</param>- /// <param name="target">The target.</param>- /// <param name="cancellationToken">The cancellation token.</param>- /// <returns>Task<SyncedFileInfo>.</returns>- Task<SyncedFileInfo> GetSyncedFileInfo(string id, SyncTarget target, CancellationToken cancellationToken);- }-}diff --git a/MediaBrowser.Controller/Sync/IRemoteSyncProvider.cs b/MediaBrowser.Controller/Sync/IRemoteSyncProvider.csdeleted file mode 100644index b2c53365c4..0000000000--- a/MediaBrowser.Controller/Sync/IRemoteSyncProvider.cs+++ /dev/null@@ -1,9 +0,0 @@-namespace MediaBrowser.Controller.Sync-{- /// <summary>- /// A marker interface.- /// </summary>- public interface IRemoteSyncProvider- {- }-}diff --git a/MediaBrowser.Controller/Sync/IServerSyncProvider.cs b/MediaBrowser.Controller/Sync/IServerSyncProvider.csdeleted file mode 100644index 3891ac0a66..0000000000--- a/MediaBrowser.Controller/Sync/IServerSyncProvider.cs+++ /dev/null@@ -1,32 +0,0 @@-#nullable disable--#pragma warning disable CS1591--using System;-using System.IO;-using System.Threading;-using System.Threading.Tasks;-using MediaBrowser.Model.IO;-using MediaBrowser.Model.Querying;-using MediaBrowser.Model.Sync;--namespace MediaBrowser.Controller.Sync-{- public interface IServerSyncProvider : ISyncProvider- {- /// <summary>- /// Transfers the file.- /// </summary>- Task<SyncedFileInfo> SendFile(SyncJob syncJob, string originalMediaPath, Stream inputStream, bool isMedia, string[] outputPathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);-- Task<QueryResult<FileSystemMetadata>> GetFiles(string[] directoryPathParts, SyncTarget target, CancellationToken cancellationToken);- }-- public interface ISupportsDirectCopy- {- /// <summary>- /// Sends the file.- /// </summary>- Task<SyncedFileInfo> SendFile(SyncJob syncJob, string originalMediaPath, string inputPath, bool isMedia, string[] outputPathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);- }-}diff --git a/MediaBrowser.Controller/Sync/ISyncProvider.cs b/MediaBrowser.Controller/Sync/ISyncProvider.csdeleted file mode 100644index ea20014c79..0000000000--- a/MediaBrowser.Controller/Sync/ISyncProvider.cs+++ /dev/null@@ -1,31 +0,0 @@-#nullable disable--#pragma warning disable CS1591--using System.Collections.Generic;-using MediaBrowser.Model.Sync;--namespace MediaBrowser.Controller.Sync-{- public interface ISyncProvider- {- /// <summary>- /// Gets the name.- /// </summary>- /// <value>The name.</value>- string Name { get; }-- /// <summary>- /// Gets the synchronize targets.- /// </summary>- /// <param name="userId">The user identifier.</param>- /// <returns>IEnumerable<SyncTarget>.</returns>- List<SyncTarget> GetSyncTargets(string userId);-- /// <summary>- /// Gets all synchronize targets.- /// </summary>- /// <returns>IEnumerable<SyncTarget>.</returns>- List<SyncTarget> GetAllSyncTargets();- }-}diff --git a/MediaBrowser.Controller/Sync/SyncedFileInfo.cs b/MediaBrowser.Controller/Sync/SyncedFileInfo.csdeleted file mode 100644index 7eac52299b..0000000000--- a/MediaBrowser.Controller/Sync/SyncedFileInfo.cs+++ /dev/null@@ -1,43 +0,0 @@-#nullable disable--#pragma warning disable CS1591--using System.Collections.Generic;-using MediaBrowser.Model.MediaInfo;--namespace MediaBrowser.Controller.Sync-{- public class SyncedFileInfo- {- public SyncedFileInfo()- {- RequiredHttpHeaders = new Dictionary<string, string>();- }-- /// <summary>- /// Gets or sets the path.- /// </summary>- /// <value>The path.</value>- public string Path { get; set; }-- public string[] PathParts { get; set; }-- /// <summary>- /// Gets or sets the protocol.- /// </summary>- /// <value>The protocol.</value>- public MediaProtocol Protocol { get; set; }-- /// <summary>- /// Gets or sets the required HTTP headers.- /// </summary>- /// <value>The required HTTP headers.</value>- public Dictionary<string, string> RequiredHttpHeaders { get; set; }-- /// <summary>- /// Gets or sets the identifier.- /// </summary>- /// <value>The identifier.</value>- public string Id { get; set; }- }-}diff --git a/MediaBrowser.Controller/TV/ITVSeriesManager.cs b/MediaBrowser.Controller/TV/ITVSeriesManager.csindex 291dea04ef..328cf18f69 100644--- a/MediaBrowser.Controller/TV/ITVSeriesManager.cs+++ b/MediaBrowser.Controller/TV/ITVSeriesManager.cs@@ -6,16 +6,26 @@ using MediaBrowser.Model.Querying;namespace MediaBrowser.Controller.TV{+ /// <summary>+ /// The TV Series manager.+ /// </summary>public interface ITVSeriesManager{/// <summary>/// Gets the next up./// </summary>+ /// <param name="query">The next up query.</param>+ /// <param name="options">The dto options.</param>+ /// <returns>The query result of <see cref="BaseItem"/>.</returns>QueryResult<BaseItem> GetNextUp(NextUpQuery query, DtoOptions options);/// <summary>/// Gets the next up./// </summary>+ /// <param name="request">The next up request.</param>+ /// <param name="parentsFolders">The list of parent folders.</param>+ /// <param name="options">The dto options.</param>+ /// <returns>The query result of <see cref="BaseItem"/>.</returns>QueryResult<BaseItem> GetNextUp(NextUpQuery request, BaseItem[] parentsFolders, DtoOptions options);}}