The Free Software Media System - Server Backend & API
Remove warninigs from MediaBrowser.Controller (Part 3) (#6078)
Cody Robiberod461e3912a1d
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.csindex f8d8197d46..4af1f10f05 100644--- a/Emby.Server.Implementations/Library/LibraryManager.cs+++ b/Emby.Server.Implementations/Library/LibraryManager.cs@@ -1065,17 +1065,17 @@ namespace Emby.Server.Implementations.Library// Start by just validating the children of the root, but go no furtherawait RootFolder.ValidateChildren(new SimpleProgress<double>(),- cancellationToken,new MetadataRefreshOptions(new DirectoryService(_fileSystem)),- recursive: false).ConfigureAwait(false);+ recursive: false,+ cancellationToken).ConfigureAwait(false);await GetUserRootFolder().RefreshMetadata(cancellationToken).ConfigureAwait(false);await GetUserRootFolder().ValidateChildren(new SimpleProgress<double>(),- cancellationToken,new MetadataRefreshOptions(new DirectoryService(_fileSystem)),- recursive: false).ConfigureAwait(false);+ recursive: false,+ cancellationToken).ConfigureAwait(false);// Quickly scan CollectionFolders for changesforeach (var folder in GetUserRootFolder().Children.OfType<Folder>())@@ -1095,7 +1095,7 @@ namespace Emby.Server.Implementations.LibraryinnerProgress.RegisterAction(pct => progress.Report(pct * 0.96));// Validate the entire media library- await RootFolder.ValidateChildren(innerProgress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), recursive: true).ConfigureAwait(false);+ await RootFolder.ValidateChildren(innerProgress, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), recursive: true, cancellationToken).ConfigureAwait(false);progress.Report(96);diff --git a/MediaBrowser.Controller/Channels/IDisableMediaSourceDisplay.cs b/MediaBrowser.Controller/Channels/IDisableMediaSourceDisplay.csindex a2dc5682dd..8d0d8dc9f3 100644--- a/MediaBrowser.Controller/Channels/IDisableMediaSourceDisplay.cs+++ b/MediaBrowser.Controller/Channels/IDisableMediaSourceDisplay.cs@@ -1,7 +1,13 @@-#pragma warning disable CS1591+#pragma warning disable CA1040 // Avoid empty interfacesnamespace MediaBrowser.Controller.Channels{+ /// <summary>+ /// Disable media source display.+ /// </summary>+ /// <remarks>+ /// <see cref="Channel"/> can inherit this interface to disable being displayed.+ /// </remarks>public interface IDisableMediaSourceDisplay{}diff --git a/MediaBrowser.Controller/Channels/ISupportsMediaProbe.cs b/MediaBrowser.Controller/Channels/ISupportsMediaProbe.csindex 2682de51c4..e411b081c1 100644--- a/MediaBrowser.Controller/Channels/ISupportsMediaProbe.cs+++ b/MediaBrowser.Controller/Channels/ISupportsMediaProbe.cs@@ -1,7 +1,10 @@-#pragma warning disable CS1591+#pragma warning disable CA1040 // Avoid empty interfacesnamespace MediaBrowser.Controller.Channels{+ /// <summary>+ /// Channel supports media probe.+ /// </summary>public interface ISupportsMediaProbe{}diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.csindex 533130fc8e..fe1bc62aba 100644--- a/MediaBrowser.Controller/Entities/AggregateFolder.cs+++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs@@ -155,11 +155,11 @@ namespace MediaBrowser.Controller.Entitiesreturn base.GetNonCachedChildren(directoryService).Concat(_virtualChildren);}- protected override async Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)+ protected override async Task ValidateChildrenInternal(IProgress<double> progress, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken){ClearCache();- await base.ValidateChildrenInternal(progress, cancellationToken, recursive, refreshChildMetadata, refreshOptions, directoryService)+ await base.ValidateChildrenInternal(progress, recursive, refreshChildMetadata, refreshOptions, directoryService, cancellationToken).ConfigureAwait(false);ClearCache();@@ -185,7 +185,7 @@ namespace MediaBrowser.Controller.Entities/// </summary>/// <param name="id">The id.</param>/// <returns>BaseItem.</returns>- /// <exception cref="ArgumentNullException">id</exception>+ /// <exception cref="ArgumentNullException">The id is empty.</exception>public BaseItem FindVirtualChild(Guid id){if (id.Equals(Guid.Empty))diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.csindex 4c2b7cb7c7..576ab67a22 100644--- a/MediaBrowser.Controller/Entities/Audio/Audio.cs+++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs@@ -4,6 +4,7 @@using System;using System.Collections.Generic;+using System.Globalization;using System.Linq;using System.Text.Json.Serialization;using Jellyfin.Data.Enums;@@ -82,19 +83,19 @@ namespace MediaBrowser.Controller.Entities.Audio/// <returns>System.String.</returns>protected override string CreateSortName(){- return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ") : "")- + (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;+ return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ", CultureInfo.InvariantCulture) : string.Empty)+ + (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ", CultureInfo.InvariantCulture) : string.Empty) + Name;}public override List<string> GetUserDataKeys(){var list = base.GetUserDataKeys();- var songKey = IndexNumber.HasValue ? IndexNumber.Value.ToString("0000") : string.Empty;+ var songKey = IndexNumber.HasValue ? IndexNumber.Value.ToString("0000", CultureInfo.InvariantCulture) : string.Empty;if (ParentIndexNumber.HasValue){- songKey = ParentIndexNumber.Value.ToString("0000") + "-" + songKey;+ songKey = ParentIndexNumber.Value.ToString("0000", CultureInfo.InvariantCulture) + "-" + songKey;}songKey += Name;diff --git a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs b/MediaBrowser.Controller/Entities/Audio/MusicArtist.csindex 0928a8073b..c0cd81110e 100644--- a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs+++ b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs@@ -94,7 +94,7 @@ namespace MediaBrowser.Controller.Entities.Audioreturn base.IsSaveLocalMetadataEnabled();}- protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)+ protected override Task ValidateChildrenInternal(IProgress<double> progress, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken){if (IsAccessedByName){@@ -102,7 +102,7 @@ namespace MediaBrowser.Controller.Entities.Audioreturn Task.CompletedTask;}- return base.ValidateChildrenInternal(progress, cancellationToken, recursive, refreshChildMetadata, refreshOptions, directoryService);+ return base.ValidateChildrenInternal(progress, recursive, refreshChildMetadata, refreshOptions, directoryService, cancellationToken);}public override List<string> GetUserDataKeys()diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.csindex 6e46b4cec8..fcb120ad76 100644--- a/MediaBrowser.Controller/Entities/BaseItem.cs+++ b/MediaBrowser.Controller/Entities/BaseItem.cs@@ -620,7 +620,11 @@ namespace MediaBrowser.Controller.Entitiespublic string ForcedSortName{get => _forcedSortName;- set { _forcedSortName = value; _sortName = null; }+ set+ {+ _forcedSortName = value;+ _sortName = null;+ }}private string _sortName;@@ -1337,7 +1341,7 @@ namespace MediaBrowser.Controller.Entities}// Use some hackery to get the extra type based on foldername- item.ExtraType = Enum.TryParse(extraFolderName.Replace(" ", string.Empty), true, out ExtraType extraType)+ item.ExtraType = Enum.TryParse(extraFolderName.Replace(" ", string.Empty, StringComparison.Ordinal), true, out ExtraType extraType)? extraType: Model.Entities.ExtraType.Unknown;@@ -1427,10 +1431,10 @@ namespace MediaBrowser.Controller.Entities/// Refreshes owned items such as trailers, theme videos, special features, etc./// Returns true or false indicating if changes were found./// </summary>- /// <param name="options"></param>- /// <param name="fileSystemChildren"></param>- /// <param name="cancellationToken"></param>- /// <returns></returns>+ /// <param name="options">The metadata refresh options.</param>+ /// <param name="fileSystemChildren">The list of filesystem children.</param>+ /// <param name="cancellationToken">The cancellation token.</param>+ /// <returns><c>true</c> if any items have changed, else <c>false</c>.</returns>protected virtual async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken){var themeSongsChanged = false;@@ -1772,7 +1776,7 @@ namespace MediaBrowser.Controller.Entities/// </summary>/// <param name="user">The user.</param>/// <returns><c>true</c> if [is parental allowed] [the specified user]; otherwise, <c>false</c>.</returns>- /// <exception cref="ArgumentNullException">user</exception>+ /// <exception cref="ArgumentNullException">If user is null.</exception>public bool IsParentalAllowed(User user){if (user == null)@@ -1917,7 +1921,7 @@ namespace MediaBrowser.Controller.Entities/// </summary>/// <param name="user">The user.</param>/// <returns><c>true</c> if the specified user is visible; otherwise, <c>false</c>.</returns>- /// <exception cref="ArgumentNullException">user</exception>+ /// <exception cref="ArgumentNullException"><paramref name="user" /> is <c>null</c>.</exception>public virtual bool IsVisible(User user){if (user == null)@@ -2215,7 +2219,7 @@ namespace MediaBrowser.Controller.Entities/// <param name="type">The type.</param>/// <param name="imageIndex">Index of the image.</param>/// <returns><c>true</c> if the specified type has image; otherwise, <c>false</c>.</returns>- /// <exception cref="ArgumentException">Backdrops should be accessed using Item.Backdrops</exception>+ /// <exception cref="ArgumentException">Backdrops should be accessed using Item.Backdrops.</exception>public bool HasImage(ImageType type, int imageIndex){return GetImageInfo(type, imageIndex) != null;@@ -2344,9 +2348,8 @@ namespace MediaBrowser.Controller.Entities/// <param name="imageType">Type of the image.</param>/// <param name="imageIndex">Index of the image.</param>/// <returns>System.String.</returns>- /// <exception cref="InvalidOperationException">- /// </exception>- /// <exception cref="ArgumentNullException">item</exception>+ /// <exception cref="InvalidOperationException"> </exception>+ /// <exception cref="ArgumentNullException">Item is null.</exception>public string GetImagePath(ImageType imageType, int imageIndex)=> GetImageInfo(imageType, imageIndex)?.Path;@@ -2442,7 +2445,7 @@ namespace MediaBrowser.Controller.Entities/// <param name="imageType">Type of the image.</param>/// <param name="images">The images.</param>/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>- /// <exception cref="ArgumentException">Cannot call AddImages with chapter images</exception>+ /// <exception cref="ArgumentException">Cannot call AddImages with chapter images.</exception>public bool AddImages(ImageType imageType, List<FileSystemMetadata> images){if (imageType == ImageType.Chapter)@@ -2526,10 +2529,11 @@ namespace MediaBrowser.Controller.Entities/// <summary>/// Gets the file system path to delete when the item is to be deleted./// </summary>- /// <returns></returns>+ /// <returns>The metadata for the deleted paths.</returns>public virtual IEnumerable<FileSystemMetadata> GetDeletePaths(){- return new[] {+ return new[]+ {new FileSystemMetadata{FullName = Path,@@ -2889,7 +2893,7 @@ namespace MediaBrowser.Controller.Entities/// <summary>/// Updates the official rating based on content and returns true or false indicating if it changed./// </summary>- /// <returns></returns>+ /// <returns><c>true</c> if the rating was updated; otherwise <c>false</c>.</returns>public bool UpdateRatingToItems(IList<BaseItem> children){var currentOfficialRating = OfficialRating;@@ -2905,7 +2909,9 @@ namespace MediaBrowser.Controller.EntitiesOfficialRating = ratings.FirstOrDefault() ?? currentOfficialRating;- return !string.Equals(currentOfficialRating ?? string.Empty, OfficialRating ?? string.Empty,+ return !string.Equals(+ currentOfficialRating ?? string.Empty,+ OfficialRating ?? string.Empty,StringComparison.OrdinalIgnoreCase);}@@ -3002,7 +3008,7 @@ namespace MediaBrowser.Controller.Entities}/// <inheritdoc />- public bool Equals(BaseItem item) => Object.Equals(Id, item?.Id);+ public bool Equals(BaseItem other) => object.Equals(Id, other?.Id);/// <inheritdoc />public override int GetHashCode() => HashCode.Combine(Id);diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.csindex d0fb3997d5..4a721ca44f 100644--- a/MediaBrowser.Controller/Entities/CollectionFolder.cs+++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs@@ -315,16 +315,16 @@ namespace MediaBrowser.Controller.Entities/// <summary>/// Compare our current children (presumably just read from the repo) with the current state of the file system and adjust for any changes- /// ***Currently does not contain logic to maintain items that are unavailable in the file system***+ /// ***Currently does not contain logic to maintain items that are unavailable in the file system***./// </summary>/// <param name="progress">The progress.</param>- /// <param name="cancellationToken">The cancellation token.</param>/// <param name="recursive">if set to <c>true</c> [recursive].</param>/// <param name="refreshChildMetadata">if set to <c>true</c> [refresh child metadata].</param>/// <param name="refreshOptions">The refresh options.</param>/// <param name="directoryService">The directory service.</param>+ /// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)+ protected override Task ValidateChildrenInternal(IProgress<double> progress, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken){return Task.CompletedTask;}diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.csindex 29d837c143..bce2848311 100644--- a/MediaBrowser.Controller/Entities/Folder.cs+++ b/MediaBrowser.Controller/Entities/Folder.cs@@ -207,8 +207,7 @@ namespace MediaBrowser.Controller.Entities/// </summary>/// <param name="item">The item.</param>/// <param name="cancellationToken">The cancellation token.</param>- /// <returns>Task.</returns>- /// <exception cref="InvalidOperationException">Unable to add + item.Name</exception>+ /// <exception cref="InvalidOperationException">Unable to add + item.Name.</exception>public void AddChild(BaseItem item, CancellationToken cancellationToken){item.SetParent(this);@@ -274,20 +273,20 @@ namespace MediaBrowser.Controller.Entitiespublic Task ValidateChildren(IProgress<double> progress, CancellationToken cancellationToken){- return ValidateChildren(progress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(FileSystem)));+ return ValidateChildren(progress, new MetadataRefreshOptions(new DirectoryService(FileSystem)), cancellationToken: cancellationToken);}/// <summary>/// Validates that the children of the folder still exist./// </summary>/// <param name="progress">The progress.</param>- /// <param name="cancellationToken">The cancellation token.</param>/// <param name="metadataRefreshOptions">The metadata refresh options.</param>/// <param name="recursive">if set to <c>true</c> [recursive].</param>+ /// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- public Task ValidateChildren(IProgress<double> progress, CancellationToken cancellationToken, MetadataRefreshOptions metadataRefreshOptions, bool recursive = true)+ public Task ValidateChildren(IProgress<double> progress, MetadataRefreshOptions metadataRefreshOptions, bool recursive = true, CancellationToken cancellationToken = default){- return ValidateChildrenInternal(progress, cancellationToken, recursive, true, metadataRefreshOptions, metadataRefreshOptions.DirectoryService);+ return ValidateChildrenInternal(progress, recursive, true, metadataRefreshOptions, metadataRefreshOptions.DirectoryService, cancellationToken);}private Dictionary<Guid, BaseItem> GetActualChildrenDictionary()@@ -327,13 +326,13 @@ namespace MediaBrowser.Controller.Entities/// Validates the children internal./// </summary>/// <param name="progress">The progress.</param>- /// <param name="cancellationToken">The cancellation token.</param>/// <param name="recursive">if set to <c>true</c> [recursive].</param>/// <param name="refreshChildMetadata">if set to <c>true</c> [refresh child metadata].</param>/// <param name="refreshOptions">The refresh options.</param>/// <param name="directoryService">The directory service.</param>+ /// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- protected virtual async Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)+ protected virtual async Task ValidateChildrenInternal(IProgress<double> progress, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken){if (recursive){@@ -342,7 +341,7 @@ namespace MediaBrowser.Controller.Entitiestry{- await ValidateChildrenInternal2(progress, cancellationToken, recursive, refreshChildMetadata, refreshOptions, directoryService).ConfigureAwait(false);+ await ValidateChildrenInternal2(progress, recursive, refreshChildMetadata, refreshOptions, directoryService, cancellationToken).ConfigureAwait(false);}finally{@@ -353,7 +352,7 @@ namespace MediaBrowser.Controller.Entities}}- private async Task ValidateChildrenInternal2(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)+ private async Task ValidateChildrenInternal2(IProgress<double> progress, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken){cancellationToken.ThrowIfCancellationRequested();@@ -575,7 +574,7 @@ namespace MediaBrowser.Controller.Entitiesprivate Task ValidateSubFolders(IList<Folder> children, IDirectoryService directoryService, IProgress<double> progress, CancellationToken cancellationToken){return RunTasks(- (folder, innerProgress) => folder.ValidateChildrenInternal(innerProgress, cancellationToken, true, false, null, directoryService),+ (folder, innerProgress) => folder.ValidateChildrenInternal(innerProgress, true, false, null, directoryService, cancellationToken),children,progress,cancellationToken);@@ -1013,7 +1012,7 @@ namespace MediaBrowser.Controller.Entitiesif (!string.IsNullOrEmpty(query.NameStartsWith)){- items = items.Where(i => i.SortName.StartsWith(query.NameStartsWith, StringComparison.OrdinalIgnoreCase));+ items = items.Where(i => i.SortName.StartsWith(query.NameStartsWith, StringComparison.CurrentCultureIgnoreCase));}if (!string.IsNullOrEmpty(query.NameLessThan))@@ -1324,7 +1323,6 @@ namespace MediaBrowser.Controller.Entities/// <summary>/// Adds the children to list./// </summary>- /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>private void AddChildren(User user, bool includeLinkedChildren, Dictionary<Guid, BaseItem> result, bool recursive, InternalItemsQuery query){foreach (var child in GetEligibleChildrenForRecursiveChildren(user))@@ -1596,7 +1594,8 @@ namespace MediaBrowser.Controller.Entities/// <summary>/// Refreshes the linked children./// </summary>- /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>+ /// <param name="fileSystemChildren">The enumerable of file system metadata.</param>+ /// <returns><c>true</c> if the linked children were updated, <c>false</c> otherwise.</returns>protected virtual bool RefreshLinkedChildren(IEnumerable<FileSystemMetadata> fileSystemChildren){if (SupportsShortcutChildren)diff --git a/MediaBrowser.Controller/Entities/Genre.cs b/MediaBrowser.Controller/Entities/Genre.csindex 698643b446..b80a5be3b9 100644--- a/MediaBrowser.Controller/Entities/Genre.cs+++ b/MediaBrowser.Controller/Entities/Genre.cs@@ -107,7 +107,11 @@ namespace MediaBrowser.Controller.Entitiesreturn base.RequiresRefresh();}- /// <inheridoc />+ /// <summary>+ /// This is called before any metadata refresh and returns true if changes were made.+ /// </summary>+ /// <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(replaceAllMetadata);diff --git a/MediaBrowser.Controller/Entities/IHasScreenshots.cs b/MediaBrowser.Controller/Entities/IHasScreenshots.csindex b027a0cb13..f894b35dbd 100644--- a/MediaBrowser.Controller/Entities/IHasScreenshots.cs+++ b/MediaBrowser.Controller/Entities/IHasScreenshots.cs@@ -1,7 +1,9 @@+#pragma warning disable CA1040 // Avoid empty interfaces+namespace MediaBrowser.Controller.Entities{/// <summary>- /// Interface IHasScreenshots.+ /// The item has screenshots./// </summary>public interface IHasScreenshots{diff --git a/MediaBrowser.Controller/Entities/ISupportsBoxSetGrouping.cs b/MediaBrowser.Controller/Entities/ISupportsBoxSetGrouping.csindex 7d13bf3259..1077f462d1 100644--- a/MediaBrowser.Controller/Entities/ISupportsBoxSetGrouping.cs+++ b/MediaBrowser.Controller/Entities/ISupportsBoxSetGrouping.cs@@ -1,3 +1,5 @@+#pragma warning disable CA1040 // Avoid empty interfaces+namespace MediaBrowser.Controller.Entities{/// <summary>diff --git a/MediaBrowser.Controller/Entities/LinkedChildComparer.cs b/MediaBrowser.Controller/Entities/LinkedChildComparer.csindex 66fc44b8a9..4e58e29429 100644--- a/MediaBrowser.Controller/Entities/LinkedChildComparer.cs+++ b/MediaBrowser.Controller/Entities/LinkedChildComparer.cs@@ -2,6 +2,7 @@#pragma warning disable CS1591+using System;using System.Collections.Generic;using MediaBrowser.Model.IO;@@ -28,7 +29,7 @@ namespace MediaBrowser.Controller.Entitiespublic int GetHashCode(LinkedChild obj){- return ((obj.Path ?? string.Empty) + (obj.LibraryItemId ?? string.Empty) + obj.Type).GetHashCode();+ return ((obj.Path ?? string.Empty) + (obj.LibraryItemId ?? string.Empty) + obj.Type).GetHashCode(StringComparison.Ordinal);}}}\ No newline at end of filediff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.csindex 1b4cc7a78b..31c179bcac 100644--- a/MediaBrowser.Controller/Entities/TV/Episode.cs+++ b/MediaBrowser.Controller/Entities/TV/Episode.cs@@ -218,8 +218,8 @@ namespace MediaBrowser.Controller.Entities.TV/// <returns>System.String.</returns>protected override string CreateSortName(){- return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("000 - ") : "")- + (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;+ return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("000 - ", CultureInfo.InvariantCulture) : string.Empty)+ + (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ", CultureInfo.InvariantCulture) : string.Empty) + Name;}/// <summary>@@ -287,7 +287,8 @@ namespace MediaBrowser.Controller.Entities.TVpublic override IEnumerable<FileSystemMetadata> GetDeletePaths(){- return new[] {+ return new[]+ {new FileSystemMetadata{FullName = Path,diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.csindex 5e2053dcc7..aa62bb35b0 100644--- a/MediaBrowser.Controller/Entities/TV/Season.cs+++ b/MediaBrowser.Controller/Entities/TV/Season.cs@@ -122,7 +122,7 @@ namespace MediaBrowser.Controller.Entities.TVvar series = Series;if (series != null){- return series.PresentationUniqueKey + "-" + (IndexNumber ?? 0).ToString("000");+ return series.PresentationUniqueKey + "-" + (IndexNumber ?? 0).ToString("000", CultureInfo.InvariantCulture);}}@@ -135,7 +135,7 @@ namespace MediaBrowser.Controller.Entities.TV/// <returns>System.String.</returns>protected override string CreateSortName(){- return IndexNumber != null ? IndexNumber.Value.ToString("0000") : Name;+ return IndexNumber != null ? IndexNumber.Value.ToString("0000", CultureInfo.InvariantCulture) : Name;}protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)diff --git a/MediaBrowser.Controller/Entities/UserRootFolder.cs b/MediaBrowser.Controller/Entities/UserRootFolder.csindex 2dea2e50bf..2b15a52f09 100644--- a/MediaBrowser.Controller/Entities/UserRootFolder.cs+++ b/MediaBrowser.Controller/Entities/UserRootFolder.cs@@ -109,11 +109,11 @@ namespace MediaBrowser.Controller.Entitiesreturn base.GetNonCachedChildren(directoryService);}- protected override async Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)+ protected override async Task ValidateChildrenInternal(IProgress<double> progress, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken){ClearCache();- await base.ValidateChildrenInternal(progress, cancellationToken, recursive, refreshChildMetadata, refreshOptions, directoryService)+ await base.ValidateChildrenInternal(progress, recursive, refreshChildMetadata, refreshOptions, directoryService, cancellationToken).ConfigureAwait(false);ClearCache();diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.csindex 1e6c01bf8b..57dc9b59ba 100644--- a/MediaBrowser.Controller/Entities/UserView.cs+++ b/MediaBrowser.Controller/Entities/UserView.cs@@ -172,7 +172,7 @@ namespace MediaBrowser.Controller.Entitiesreturn OriginalFolderViewTypes.Contains(viewType ?? string.Empty, StringComparer.OrdinalIgnoreCase);}- protected override Task ValidateChildrenInternal(IProgress<double> progress, System.Threading.CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, Providers.MetadataRefreshOptions refreshOptions, Providers.IDirectoryService directoryService)+ protected override Task ValidateChildrenInternal(IProgress<double> progress, bool recursive, bool refreshChildMetadata, Providers.MetadataRefreshOptions refreshOptions, Providers.IDirectoryService directoryService, System.Threading.CancellationToken cancellationToken){return Task.CompletedTask;}diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.csindex 15a4573c2e..add734f626 100644--- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs+++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs@@ -55,12 +55,12 @@ namespace MediaBrowser.Controller.Entities// if (query.IncludeItemTypes != null &&// query.IncludeItemTypes.Length == 1 &&// string.Equals(query.IncludeItemTypes[0], "Playlist", StringComparison.OrdinalIgnoreCase))- //{+ // {// if (!string.Equals(viewType, CollectionType.Playlists, StringComparison.OrdinalIgnoreCase))// {// return await FindPlaylists(queryParent, user, query).ConfigureAwait(false);// }- //}+ // }switch (viewType){@@ -344,12 +344,14 @@ namespace MediaBrowser.Controller.Entitiesvar parentFolders = GetMediaFolders(parent, query.User, new[] { CollectionType.TvShows, string.Empty });var result = _tvSeriesManager.GetNextUp(- new NextUpQuery- {- Limit = query.Limit,- StartIndex = query.StartIndex,- UserId = query.User.Id- }, parentFolders, query.DtoOptions);+ new NextUpQuery+ {+ Limit = query.Limit,+ StartIndex = query.StartIndex,+ UserId = query.User.Id+ },+ parentFolders,+ query.DtoOptions);return result;}diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.csindex 723027a883..d05b5df2f1 100644--- a/MediaBrowser.Controller/Entities/Video.cs+++ b/MediaBrowser.Controller/Entities/Video.cs@@ -482,7 +482,8 @@ namespace MediaBrowser.Controller.Entities{if (!IsInMixedFolder){- return new[] {+ return new[]+ {new FileSystemMetadata{FullName = ContainingFolderPath,diff --git a/MediaBrowser.Controller/IO/FileData.cs b/MediaBrowser.Controller/IO/FileData.csindex 3db60ae0bb..b8a0bf3315 100644--- a/MediaBrowser.Controller/IO/FileData.cs+++ b/MediaBrowser.Controller/IO/FileData.cs@@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.IO/// <param name="flattenFolderDepth">The flatten folder depth.</param>/// <param name="resolveShortcuts">if set to <c>true</c> [resolve shortcuts].</param>/// <returns>Dictionary{System.StringFileSystemInfo}.</returns>- /// <exception cref="ArgumentNullException">path</exception>+ /// <exception cref="ArgumentNullException"><paramref name="path" /> is <c>null</c> or empty.</exception>public static FileSystemMetadata[] GetFilteredFileSystemEntries(IDirectoryService directoryService,string path,diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.csindex 3fd4ff899a..0593e65f5c 100644--- a/MediaBrowser.Controller/Library/ILibraryManager.cs+++ b/MediaBrowser.Controller/Library/ILibraryManager.cs@@ -352,6 +352,7 @@ 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>+ /// <returns>The named view.</returns>UserView GetNamedView(string name,Guid parentId,@@ -365,10 +366,11 @@ 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>+ /// <returns>The shadow view.</returns>UserView GetShadowView(BaseItem parent,- string viewType,- string sortName);+ string viewType,+ string sortName);/// <summary>/// Determines whether [is video file] [the specified path].diff --git a/MediaBrowser.Controller/Library/IUserDataManager.cs b/MediaBrowser.Controller/Library/IUserDataManager.csindex 58499e8531..e5dcfcff04 100644--- a/MediaBrowser.Controller/Library/IUserDataManager.cs+++ b/MediaBrowser.Controller/Library/IUserDataManager.cs@@ -49,17 +49,16 @@ namespace MediaBrowser.Controller.Library/// <summary>/// Get all user data for the given user./// </summary>- /// <param name="userId"></param>- /// <returns></returns>+ /// <param name="userId">The user id.</param>+ /// <returns>The user item data.</returns>List<UserItemData> GetAllUserData(Guid userId);/// <summary>/// Save the all provided user data for the given user./// </summary>- /// <param name="userId"></param>- /// <param name="userData"></param>- /// <param name="cancellationToken"></param>- /// <returns></returns>+ /// <param name="userId">The user id.</param>+ /// <param name="userData">The array of user data.</param>+ /// <param name="cancellationToken">The cancellation token.</param>void SaveAllUserData(Guid userId, UserItemData[] userData, CancellationToken cancellationToken);/// <summary>diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.csindex c95b0ea321..1801b1c413 100644--- a/MediaBrowser.Controller/Library/IUserManager.cs+++ b/MediaBrowser.Controller/Library/IUserManager.cs@@ -61,16 +61,16 @@ namespace MediaBrowser.Controller.Library/// <param name="user">The user.</param>/// <param name="newName">The new name.</param>/// <returns>Task.</returns>- /// <exception cref="ArgumentNullException">user</exception>- /// <exception cref="ArgumentException"></exception>+ /// <exception cref="ArgumentNullException">If user is <c>null</c>.</exception>+ /// <exception cref="ArgumentException">If the provided user doesn't exist.</exception>Task RenameUser(User user, string newName);/// <summary>/// Updates the user./// </summary>/// <param name="user">The user.</param>- /// <exception cref="ArgumentNullException">user</exception>- /// <exception cref="ArgumentException"></exception>+ /// <exception cref="ArgumentNullException">If user is <c>null</c>.</exception>+ /// <exception cref="ArgumentException">If the provided user doesn't exist.</exception>void UpdateUser(User user);/// <summary>@@ -87,8 +87,8 @@ namespace MediaBrowser.Controller.Library/// </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>+ /// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c> or empty.</exception>+ /// <exception cref="ArgumentException"><paramref name="name"/> already exists.</exception>Task<User> CreateUserAsync(string name);/// <summary>diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.csindex 0e2d8fb021..521e372742 100644--- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs+++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs@@ -39,7 +39,7 @@ namespace MediaBrowser.Controller.Librarypublic IDirectoryService DirectoryService { get; }/// <summary>- /// Gets the file system children.+ /// Gets or sets the file system children./// </summary>/// <value>The file system children.</value>public FileSystemMetadata[] FileSystemChildren { get; set; }@@ -242,14 +242,14 @@ namespace MediaBrowser.Controller.Library/// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>public override int GetHashCode(){- return Path.GetHashCode();+ return Path.GetHashCode(StringComparison.Ordinal);}/// <summary>/// Equals the specified args./// </summary>/// <param name="args">The args.</param>- /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>+ /// <returns><c>true</c> if the arguments are the same, <c>false</c> otherwise.</returns>protected bool Equals(ItemResolveArgs args){if (args != null)diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.csindex e2adec0009..9d638a0bf6 100644--- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs+++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs@@ -53,6 +53,7 @@ namespace MediaBrowser.Controller.LiveTv}private static string EmbyServiceName = "Emby";+public override double GetDefaultPrimaryImageAspectRatio(){var serviceName = ServiceName;@@ -150,14 +151,14 @@ namespace MediaBrowser.Controller.LiveTv[JsonIgnore]public override string ContainingFolderPath => Path;- //[JsonIgnore]+ // [JsonIgnore]// public override string MediaType- //{+ // {// get// {// return ChannelType == ChannelType.TV ? Model.Entities.MediaType.Video : Model.Entities.MediaType.Audio;// }- //}+ // }[JsonIgnore]public bool IsAiringdiff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs b/MediaBrowser.Controller/MediaEncoding/BaseEncodingJobOptions.cssimilarity index 98%rename from MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.csrename to MediaBrowser.Controller/MediaEncoding/BaseEncodingJobOptions.csindex 61f3bc7711..745ee6bdb5 100644--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs+++ b/MediaBrowser.Controller/MediaEncoding/BaseEncodingJobOptions.cs@@ -1,4 +1,4 @@-#nullable disable+#nullable disable#pragma warning disable CS1591@@ -8,7 +8,6 @@ using MediaBrowser.Model.Dlna;namespace MediaBrowser.Controller.MediaEncoding{- // For now until api and media encoding layers are unifiedpublic class BaseEncodingJobOptions{/// <summary>@@ -202,4 +201,4 @@ namespace MediaBrowser.Controller.MediaEncodingStreamOptions = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);}}-}+}\ No newline at end of filediff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.csindex feb5883e58..26b0bc3def 100644--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs@@ -1166,7 +1166,9 @@ namespace MediaBrowser.Controller.MediaEncodingprofileScore = Math.Min(profileScore, 2);// http://www.webmproject.org/docs/encoder-parameters/- param += string.Format(CultureInfo.InvariantCulture, " -speed 16 -quality good -profile:v {0} -slices 8 -crf {1} -qmin {2} -qmax {3}",+ param += string.Format(+ CultureInfo.InvariantCulture,+ " -speed 16 -quality good -profile:v {0} -slices 8 -crf {1} -qmin {2} -qmax {3}",profileScore.ToString(_usCulture),crf,qmin,@@ -1296,7 +1298,7 @@ namespace MediaBrowser.Controller.MediaEncoding// hevc_qsv use -level 51 instead of -level 153.if (double.TryParse(level, NumberStyles.Any, _usCulture, out double hevcLevel)){- param += " -level " + hevcLevel / 3;+ param += " -level " + (hevcLevel / 3);}}else if (string.Equals(videoEncoder, "h264_amf", StringComparison.OrdinalIgnoreCase)@@ -1392,7 +1394,7 @@ namespace MediaBrowser.Controller.MediaEncodingvar requestedProfile = requestedProfiles[0];// strip spaces because they may be stripped out on the query string as wellif (!string.IsNullOrEmpty(videoStream.Profile)- && !requestedProfiles.Contains(videoStream.Profile.Replace(" ", "", StringComparison.Ordinal), StringComparer.OrdinalIgnoreCase))+ && !requestedProfiles.Contains(videoStream.Profile.Replace(" ", string.Empty, StringComparison.Ordinal), StringComparer.OrdinalIgnoreCase)){var currentScore = GetVideoProfileScore(videoStream.Profile);var requestedScore = GetVideoProfileScore(requestedProfile);@@ -1801,7 +1803,7 @@ namespace MediaBrowser.Controller.MediaEncodingif (isTranscodingAudio&& state.TranscodingType != TranscodingJobType.Progressive&& resultChannels.HasValue- && (resultChannels.Value > 2 && resultChannels.Value < 6 || resultChannels.Value == 7))+ && ((resultChannels.Value > 2 && resultChannels.Value < 6) || resultChannels.Value == 7)){resultChannels = 2;}@@ -2129,8 +2131,8 @@ namespace MediaBrowser.Controller.MediaEncodingreturn (null, null);}- decimal inputWidth = Convert.ToDecimal(videoWidth ?? requestedWidth);- decimal inputHeight = Convert.ToDecimal(videoHeight ?? requestedHeight);+ decimal inputWidth = Convert.ToDecimal(videoWidth ?? requestedWidth, CultureInfo.InvariantCulture);+ decimal inputHeight = Convert.ToDecimal(videoHeight ?? requestedHeight, CultureInfo.InvariantCulture);decimal outputWidth = requestedWidth.HasValue ? Convert.ToDecimal(requestedWidth.Value) : inputWidth;decimal outputHeight = requestedHeight.HasValue ? Convert.ToDecimal(requestedHeight.Value) : inputHeight;decimal maximumWidth = requestedMaxWidth.HasValue ? Convert.ToDecimal(requestedMaxWidth.Value) : outputWidth;@@ -2197,12 +2199,11 @@ namespace MediaBrowser.Controller.MediaEncodingvar isQsvHevcEncoder = videoEncoder.Contains("hevc_qsv", StringComparison.OrdinalIgnoreCase);var isTonemappingSupported = IsTonemappingSupported(state, options);var isVppTonemappingSupported = IsVppTonemappingSupported(state, options);- var isTonemappingSupportedOnVaapi = string.Equals(options.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase)&& isVaapiDecoder && (isVaapiH264Encoder || isVaapiHevcEncoder);+ var isTonemappingSupportedOnVaapi = string.Equals(options.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase) && isVaapiDecoder && (isVaapiH264Encoder || isVaapiHevcEncoder);var isTonemappingSupportedOnQsv = string.Equals(options.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase) && isVaapiDecoder && (isQsvH264Encoder || isQsvHevcEncoder);var isP010PixFmtRequired = (isTonemappingSupportedOnVaapi && (isTonemappingSupported || isVppTonemappingSupported))|| (isTonemappingSupportedOnQsv && isVppTonemappingSupported);-var outputPixFmt = "format=nv12";if (isP010PixFmtRequired){@@ -3175,8 +3176,8 @@ namespace MediaBrowser.Controller.MediaEncodingstate.ReadInputAtNativeFramerate = mediaSource.ReadAtNativeFramerate;if (state.ReadInputAtNativeFramerate- || mediaSource.Protocol == MediaProtocol.File- && string.Equals(mediaSource.Container, "wtv", StringComparison.OrdinalIgnoreCase))+ || (mediaSource.Protocol == MediaProtocol.File+ && string.Equals(mediaSource.Container, "wtv", StringComparison.OrdinalIgnoreCase))){state.InputVideoSync = "-1";state.InputAudioSync = "1";@@ -3549,7 +3550,7 @@ namespace MediaBrowser.Controller.MediaEncoding}/// <summary>- /// Gets a hw decoder name+ /// Gets a hw decoder name./// </summary>public string GetHwDecoderName(EncodingOptions options, string decoder, string videoCodec, bool isColorDepth10){@@ -3567,7 +3568,7 @@ namespace MediaBrowser.Controller.MediaEncoding}/// <summary>- /// Gets a hwaccel type to use as a hardware decoder(dxva/vaapi) depending on the system+ /// Gets a hwaccel type to use as a hardware decoder(dxva/vaapi) depending on the system./// </summary>public string GetHwaccelType(EncodingJobInfo state, EncodingOptions options, string videoCodec, bool isColorDepth10){@@ -3693,7 +3694,7 @@ namespace MediaBrowser.Controller.MediaEncodingif (flags.Count > 0){- return " -fflags " + string.Join("", flags);+ return " -fflags " + string.Join(string.Empty, flags);}return string.Empty;diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.csindex 30e2ac42f5..bc0318ad7c 100644--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs@@ -69,6 +69,7 @@ namespace MediaBrowser.Controller.MediaEncoding}private TranscodeReason[] _transcodeReasons = null;+public TranscodeReason[] TranscodeReasons{getdiff --git a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs b/MediaBrowser.Controller/MediaEncoding/JobLogger.csindex aa5e2c4038..b23c951127 100644--- a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs+++ b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs@@ -6,6 +6,7 @@ using System;using System.Globalization;using System.IO;using System.Text;+using System.Threading;using System.Threading.Tasks;using Microsoft.Extensions.Logging;diff --git a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.csindex 855467e8e3..d8995ce74a 100644--- a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs+++ b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs@@ -270,13 +270,4 @@ namespace MediaBrowser.Controller.NetGC.SuppressFinalize(this);}}-- public class WebSocketListenerState- {- public DateTime DateLastSendUtc { get; set; }-- public long InitialDelayMs { get; set; }-- public long IntervalMs { get; set; }- }}diff --git a/MediaBrowser.Controller/Net/IWebSocketConnection.cs b/MediaBrowser.Controller/Net/IWebSocketConnection.csindex e50cd97819..f1ba1ec720 100644--- a/MediaBrowser.Controller/Net/IWebSocketConnection.cs+++ b/MediaBrowser.Controller/Net/IWebSocketConnection.cs@@ -60,11 +60,11 @@ namespace MediaBrowser.Controller.Net/// <summary>/// Sends a message asynchronously./// </summary>- /// <typeparam name="T"></typeparam>+ /// <typeparam name="T">The type of websocket message data.</typeparam>/// <param name="message">The message.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- /// <exception cref="ArgumentNullException">message</exception>+ /// <exception cref="ArgumentNullException">The message is null.</exception>Task SendAsync<T>(WebSocketMessage<T> message, CancellationToken cancellationToken);Task ProcessAsync(CancellationToken cancellationToken = default);diff --git a/MediaBrowser.Controller/Net/WebSocketListenerState.cs b/MediaBrowser.Controller/Net/WebSocketListenerState.csnew file mode 100644index 0000000000..70604d60a0--- /dev/null+++ b/MediaBrowser.Controller/Net/WebSocketListenerState.cs@@ -0,0 +1,17 @@+#nullable disable++#pragma warning disable CS1591++using System;++namespace MediaBrowser.Controller.Net+{+ public class WebSocketListenerState+ {+ public DateTime DateLastSendUtc { get; set; }++ public long InitialDelayMs { get; set; }++ public long IntervalMs { get; set; }+ }+}\ No newline at end of filediff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.csindex 56fb36af2a..0a9073e7f5 100644--- a/MediaBrowser.Controller/Persistence/IItemRepository.cs+++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs@@ -49,21 +49,23 @@ namespace MediaBrowser.Controller.Persistence/// <summary>/// Gets chapters for an item./// </summary>- /// <param name="id"></param>- /// <returns></returns>+ /// <param name="id">The item.</param>+ /// <returns>The list of chapter info.</returns>List<ChapterInfo> GetChapters(BaseItem id);/// <summary>/// Gets a single chapter for an item./// </summary>- /// <param name="id"></param>- /// <param name="index"></param>- /// <returns></returns>+ /// <param name="id">The item.</param>+ /// <param name="index">The chapter index.</param>+ /// <returns>The chapter info at the specified index.</returns>ChapterInfo GetChapter(BaseItem id, int index);/// <summary>/// Saves the chapters./// </summary>+ /// <param name="id">The item id.</param>+ /// <param name="chapters">The list of chapters to save.</param>void SaveChapters(Guid id, IReadOnlyList<ChapterInfo> chapters);/// <summary>diff --git a/MediaBrowser.Controller/Persistence/IUserDataRepository.cs b/MediaBrowser.Controller/Persistence/IUserDataRepository.csindex 6f5f02123e..5fa5834c85 100644--- a/MediaBrowser.Controller/Persistence/IUserDataRepository.cs+++ b/MediaBrowser.Controller/Persistence/IUserDataRepository.cs@@ -40,17 +40,16 @@ namespace MediaBrowser.Controller.Persistence/// <summary>/// Return all user data associated with the given user./// </summary>- /// <param name="userId"></param>- /// <returns></returns>+ /// <param name="userId">The user id.</param>+ /// <returns>The list of user item data.</returns>List<UserItemData> GetAllUserData(long userId);/// <summary>/// Save all user data associated with the given user./// </summary>- /// <param name="userId"></param>- /// <param name="userData"></param>- /// <param name="cancellationToken"></param>- /// <returns></returns>+ /// <param name="userId">The user id.</param>+ /// <param name="userData">The user item data.</param>+ /// <param name="cancellationToken">The cancellation token.</param>void SaveAllUserData(long userId, UserItemData[] userData, CancellationToken cancellationToken);}}diff --git a/MediaBrowser.Controller/Playlists/Playlist.cs b/MediaBrowser.Controller/Playlists/Playlist.csindex bb9e5da1e3..3eaf235152 100644--- a/MediaBrowser.Controller/Playlists/Playlist.cs+++ b/MediaBrowser.Controller/Playlists/Playlist.cs@@ -101,7 +101,7 @@ namespace MediaBrowser.Controller.Playlistsreturn new List<BaseItem>();}- protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)+ protected override Task ValidateChildrenInternal(IProgress<double> progress, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken){return Task.CompletedTask;}diff --git a/MediaBrowser.Controller/Plugins/IRunBeforeStartup.cs b/MediaBrowser.Controller/Plugins/IRunBeforeStartup.csindex ea966c2827..11985f475b 100644--- a/MediaBrowser.Controller/Plugins/IRunBeforeStartup.cs+++ b/MediaBrowser.Controller/Plugins/IRunBeforeStartup.cs@@ -1,4 +1,6 @@-namespace MediaBrowser.Controller.Plugins+#pragma warning disable CA1040 // Avoid empty interfaces++namespace MediaBrowser.Controller.Plugins{/// <summary>/// Indicates that a <see cref="IServerEntryPoint"/> should be invoked as a pre-startup task.diff --git a/MediaBrowser.Controller/Providers/IForcedProvider.cs b/MediaBrowser.Controller/Providers/IForcedProvider.csindex 5ae4a56efc..c14c662911 100644--- a/MediaBrowser.Controller/Providers/IForcedProvider.cs+++ b/MediaBrowser.Controller/Providers/IForcedProvider.cs@@ -1,3 +1,5 @@+#pragma warning disable CA1040 // Avoid empty interfaces+namespace MediaBrowser.Controller.Providers{/// <summary>diff --git a/MediaBrowser.Controller/Resolvers/BaseItemResolver.cs b/MediaBrowser.Controller/Resolvers/ItemResolver.cssimilarity index 96%rename from MediaBrowser.Controller/Resolvers/BaseItemResolver.csrename to MediaBrowser.Controller/Resolvers/ItemResolver.csindex e77593a036..7fd54fcc69 100644--- a/MediaBrowser.Controller/Resolvers/BaseItemResolver.cs+++ b/MediaBrowser.Controller/Resolvers/ItemResolver.cs@@ -8,7 +8,7 @@ namespace MediaBrowser.Controller.Resolvers/// <summary>/// Class ItemResolver./// </summary>- /// <typeparam name="T"></typeparam>+ /// <typeparam name="T">The type of BaseItem.</typeparam>public abstract class ItemResolver<T> : IItemResolverwhere T : BaseItem, new(){diff --git a/MediaBrowser.Controller/Sorting/AlphanumComparator.cs b/MediaBrowser.Controller/Sorting/AlphanumComparator.csindex 4d9b98889f..e00cadca21 100644--- a/MediaBrowser.Controller/Sorting/AlphanumComparator.cs+++ b/MediaBrowser.Controller/Sorting/AlphanumComparator.cs@@ -121,7 +121,9 @@ namespace MediaBrowser.Controller.Sortingreturn result;}}+#pragma warning disable SA1500 // TODO remove with StyleCop.Analyzers v1.2.0 https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3196} while (pos1 < len1 && pos2 < len2);+#pragma warning restore SA1500return len1 - len2;}diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.csindex dd497845d1..2dfaa372c5 100644--- a/MediaBrowser.Providers/Manager/ProviderManager.cs+++ b/MediaBrowser.Providers/Manager/ProviderManager.cs@@ -1111,7 +1111,7 @@ namespace MediaBrowser.Providers.Managerawait RefreshCollectionFolderChildren(options, collectionFolder, cancellationToken).ConfigureAwait(false);break;case Folder folder:- await folder.ValidateChildren(new SimpleProgress<double>(), cancellationToken, options).ConfigureAwait(false);+ await folder.ValidateChildren(new SimpleProgress<double>(), options, cancellationToken: cancellationToken).ConfigureAwait(false);break;}}@@ -1122,7 +1122,7 @@ namespace MediaBrowser.Providers.Manager{await child.RefreshMetadata(options, cancellationToken).ConfigureAwait(false);- await child.ValidateChildren(new SimpleProgress<double>(), cancellationToken, options).ConfigureAwait(false);+ await child.ValidateChildren(new SimpleProgress<double>(), options, cancellationToken: cancellationToken).ConfigureAwait(false);}}@@ -1144,7 +1144,7 @@ namespace MediaBrowser.Providers.Manager.Select(i => i.MusicArtist).Where(i => i != null);- var musicArtistRefreshTasks = musicArtists.Select(i => i.ValidateChildren(new SimpleProgress<double>(), cancellationToken, options, true));+ var musicArtistRefreshTasks = musicArtists.Select(i => i.ValidateChildren(new SimpleProgress<double>(), options, true, cancellationToken));await Task.WhenAll(musicArtistRefreshTasks).ConfigureAwait(false);