diff --git a/Emby.Naming/Common/EpisodeExpression.cs b/Emby.Naming/Common/EpisodeExpression.cs index 19d3c7aab0..d001927aa2 100644 --- a/Emby.Naming/Common/EpisodeExpression.cs +++ b/Emby.Naming/Common/EpisodeExpression.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Text.RegularExpressions; namespace Emby.Naming.Common @@ -60,7 +61,7 @@ namespace Emby.Naming.Common /// /// Gets or sets optional list of date formats used for date parsing. /// - public string[] DateTimeFormats { get; set; } + public IReadOnlyList DateTimeFormats { get; set; } /// /// Gets a expressions objects (creates it if null). diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs index 192235baeb..399d86f3d7 100644 --- a/Emby.Naming/Common/NamingOptions.cs +++ b/Emby.Naming/Common/NamingOptions.cs @@ -21,8 +21,8 @@ namespace Emby.Naming.Common /// public NamingOptions() { - VideoFileExtensions = new[] - { + VideoFileExtensions = + [ ".001", ".3g2", ".3gp", @@ -77,10 +77,10 @@ namespace Emby.Naming.Common ".wmv", ".wtv", ".xvid" - }; + ]; - VideoFlagDelimiters = new[] - { + VideoFlagDelimiters = + [ '(', ')', '-', @@ -88,15 +88,15 @@ namespace Emby.Naming.Common '_', '[', ']' - }; + ]; - StubFileExtensions = new[] - { + StubFileExtensions = + [ ".disc" - }; + ]; - StubTypes = new[] - { + StubTypes = + [ new StubTypeRule( stubType: "dvd", token: "dvd"), @@ -136,32 +136,32 @@ namespace Emby.Naming.Common new StubTypeRule( stubType: "tv", token: "DSR") - }; + ]; - VideoFileStackingRules = new[] - { + VideoFileStackingRules = + [ new FileStackRule(@"^(?.*?)(?:(?<=[\]\)\}])|[ _.-]+)[\(\[]?(?cd|dvd|part|pt|dis[ck])[ _.-]*(?[0-9]+)[\)\]]?(?:\.[^.]+)?$", true), new FileStackRule(@"^(?.*?)(?:(?<=[\]\)\}])|[ _.-]+)[\(\[]?(?cd|dvd|part|pt|dis[ck])[ _.-]*(?[a-d])[\)\]]?(?:\.[^.]+)?$", false) - }; + ]; - CleanDateTimes = new[] - { + CleanDateTimes = + [ @"(.+[^_\,\.\(\)\[\]\-])[_\.\(\)\[\]\-](19[0-9]{2}|20[0-9]{2})(?![0-9]+|\W[0-9]{2}\W[0-9]{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19[0-9]{2}|20[0-9]{2})*", @"(.+[^_\,\.\(\)\[\]\-])[ _\.\(\)\[\]\-]+(19[0-9]{2}|20[0-9]{2})(?![0-9]+|\W[0-9]{2}\W[0-9]{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19[0-9]{2}|20[0-9]{2})*" - }; + ]; - CleanStrings = new[] - { + CleanStrings = + [ @"^\s*(?.+?)[ _\,\.\(\)\[\]\-](3d|sbs|tab|hsbs|htab|mvc|HDR|HDC|UHD|UltraHD|4k|ac3|dts|custom|dc|divx|divx5|dsr|dsrip|dutch|dvd|dvdrip|dvdscr|dvdscreener|screener|dvdivx|cam|fragment|fs|hdtv|hdrip|hdtvrip|internal|limited|multi|subs|ntsc|ogg|ogm|pal|pdtv|proper|repack|rerip|retail|cd[1-9]|r5|bd5|bd|se|svcd|swedish|german|read.nfo|nfofix|unrated|ws|telesync|ts|telecine|tc|brrip|bdrip|480p|480i|576p|576i|720p|720i|1080p|1080i|2160p|hrhd|hrhdtv|hddvd|bluray|blu-ray|x264|x265|h264|h265|xvid|xvidvd|xxx|www.www|AAC|DTS|\[.*\])([ _\,\.\(\)\[\]\-]|$)", @"^(?.+?)(\[.*\])", @"^\s*(?.+?)\WE[0-9]+(-|~)E?[0-9]+(\W|$)", @"^\s*\[[^\]]+\](?!\.\w+$)\s*(?.+)", @"^\s*(?.+?)\s+-\s+[0-9]+\s*$", @"^\s*(?.+?)(([-._ ](trailer|sample))|-(scene|clip|behindthescenes|deleted|deletedscene|featurette|short|interview|other|extra))$" - }; + ]; - SubtitleFileExtensions = new[] - { + SubtitleFileExtensions = + [ ".ass", ".mks", ".sami", @@ -171,17 +171,17 @@ namespace Emby.Naming.Common ".sub", ".sup", ".vtt", - }; + ]; - LyricFileExtensions = new[] - { + LyricFileExtensions = + [ ".lrc", ".elrc", ".txt" - }; + ]; - AlbumStackingPrefixes = new[] - { + AlbumStackingPrefixes = + [ "cd", "digital media", "disc", @@ -190,10 +190,10 @@ namespace Emby.Naming.Common "volume", "part", "act" - }; + ]; - ArtistSubfolders = new[] - { + ArtistSubfolders = + [ "albums", "broadcasts", "bootlegs", @@ -208,10 +208,10 @@ namespace Emby.Naming.Common "soundtracks", "spokenwords", "streets" - }; + ]; - AudioFileExtensions = new[] - { + AudioFileExtensions = + [ ".669", ".3gp", ".aa", @@ -291,33 +291,33 @@ namespace Emby.Naming.Common ".xm", ".xsp", ".ymf" - }; + ]; - MediaFlagDelimiters = new[] - { + MediaFlagDelimiters = + [ '.' - }; + ]; - MediaForcedFlags = new[] - { + MediaForcedFlags = + [ "foreign", "forced" - }; + ]; - MediaDefaultFlags = new[] - { + MediaDefaultFlags = + [ "default" - }; + ]; - MediaHearingImpairedFlags = new[] - { + MediaHearingImpairedFlags = + [ "cc", "hi", "sdh" - }; + ]; - EpisodeExpressions = new[] - { + EpisodeExpressions = + [ // *** Begin Kodi Standard Naming // new EpisodeExpression(@".*(\\|\/)(?((?![Ss]([0-9]+)[][ ._-]*[Ee]([0-9]+))[^\\\/])*)?[Ss](?[0-9]+)[][ ._-]*[Ee](?[0-9]+)([^\\/]*)$") @@ -330,23 +330,23 @@ namespace Emby.Naming.Common new EpisodeExpression(@"[^\\/]*?()\.?[Ee]([0-9]+)\.([^\\/]*)$"), new EpisodeExpression("(?[0-9]{4})[._ -](?[0-9]{2})[._ -](?[0-9]{2})", true) { - DateTimeFormats = new[] - { + DateTimeFormats = + [ "yyyy.MM.dd", "yyyy-MM-dd", "yyyy_MM_dd", "yyyy MM dd" - } + ] }, new EpisodeExpression("(?[0-9]{2})[._ -](?[0-9]{2})[._ -](?[0-9]{4})", true) { - DateTimeFormats = new[] - { + DateTimeFormats = + [ "dd.MM.yyyy", "dd-MM-yyyy", "dd_MM_yyyy", "dd MM yyyy" - } + ] }, // This isn't a Kodi naming rule, but the expression below causes false episode numbers for @@ -478,10 +478,10 @@ namespace Emby.Naming.Common { IsNamed = true }, - }; + ]; - VideoExtraRules = new[] - { + VideoExtraRules = + [ new ExtraRule( ExtraType.Trailer, ExtraRuleType.DirectoryName, @@ -691,14 +691,14 @@ namespace Emby.Naming.Common ExtraRuleType.Suffix, "-other", MediaType.Video) - }; + ]; AllExtrasTypesFolderNames = VideoExtraRules .Where(i => i.RuleType == ExtraRuleType.DirectoryName) .ToDictionary(i => i.Token, i => i.ExtraType, StringComparer.OrdinalIgnoreCase); - Format3DRules = new[] - { + Format3DRules = + [ // Kodi rules: new Format3DRule( precedingToken: "3d", @@ -725,10 +725,10 @@ namespace Emby.Naming.Common new Format3DRule("tab"), new Format3DRule("sbs3d"), new Format3DRule("mvc") - }; + ]; - AudioBookPartsExpressions = new[] - { + AudioBookPartsExpressions = + [ // Detect specified chapters, like CH 01 @"ch(?:apter)?[\s_-]?(?[0-9]+)", // Detect specified parts, like Part 02 @@ -741,14 +741,14 @@ namespace Emby.Naming.Common "(?[0-9]+)_(?[0-9]+)", // Some audiobooks are ripped from cd's, and will be named by disk number. @"dis(?:c|k)[\s_-]?(?[0-9]+)" - }; + ]; - AudioBookNamesExpressions = new[] - { + AudioBookNamesExpressions = + [ // Detect year usually in brackets after name Batman (2020) @"^(?.+?)\s*\(\s*(?[0-9]{4})\s*\)\s*$", @"^\s*(?[^ ].*?)\s*$" - }; + ]; MultipleEpisodeExpressions = new[] { diff --git a/Emby.Naming/TV/EpisodePathParser.cs b/Emby.Naming/TV/EpisodePathParser.cs index 8cd5a126e0..c2dc774363 100644 --- a/Emby.Naming/TV/EpisodePathParser.cs +++ b/Emby.Naming/TV/EpisodePathParser.cs @@ -110,11 +110,11 @@ namespace Emby.Naming.TV if (expression.IsByDate) { DateTime date; - if (expression.DateTimeFormats.Length > 0) + if (expression.DateTimeFormats.Count > 0) { if (DateTime.TryParseExact( match.Groups[0].ValueSpan, - expression.DateTimeFormats, + expression.DateTimeFormats.ToArray(), CultureInfo.InvariantCulture, DateTimeStyles.None, out date)) diff --git a/Emby.Naming/Video/FileStack.cs b/Emby.Naming/Video/FileStack.cs index 4902e6728e..8d45949543 100644 --- a/Emby.Naming/Video/FileStack.cs +++ b/Emby.Naming/Video/FileStack.cs @@ -7,7 +7,9 @@ namespace Emby.Naming.Video /// /// Object holding list of files paths with additional information. /// +#pragma warning disable CA1711 // Identifiers should not have incorrect suffix public class FileStack +#pragma warning restore CA1711 // Identifiers should not have incorrect suffix { /// /// Initializes a new instance of the class. diff --git a/Emby.Naming/Video/StackResolver.cs b/Emby.Naming/Video/StackResolver.cs index 8119a02674..6a07561a06 100644 --- a/Emby.Naming/Video/StackResolver.cs +++ b/Emby.Naming/Video/StackResolver.cs @@ -132,7 +132,7 @@ namespace Emby.Naming.Video } } - private class StackMetadata + private sealed class StackMetadata { public StackMetadata(bool isDirectory, bool isNumerical, string partType) { diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index cbb0f6c565..10f7382aba 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -121,7 +121,9 @@ namespace Emby.Server.Implementations private readonly IConfiguration _startupConfig; private readonly IXmlSerializer _xmlSerializer; private readonly IStartupOptions _startupOptions; +#pragma warning disable CA2213 // Disposable fields should be disposed private readonly PluginManager _pluginManager; +#pragma warning restore CA2213 // Disposable fields should be disposed private List _creatingInstances; diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index cf886ae826..083881a216 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -1060,7 +1060,7 @@ namespace Emby.Server.Implementations.Dto if (options.ContainsField(ItemFields.Chapters)) { - dto.Chapters = _chapterManager.GetChapters(item.Id).ToList(); + dto.Chapters = _chapterManager.GetChapters(item.Id).ToArray(); } if (options.ContainsField(ItemFields.Trickplay)) diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs index dbf05c1dbb..a18379edb9 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs @@ -39,7 +39,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio public MultiItemResolverResult ResolveMultiple( Folder parent, - List files, + IReadOnlyList files, CollectionType? collectionType, IDirectoryService directoryService) { @@ -58,7 +58,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio private MultiItemResolverResult ResolveMultipleInternal( Folder parent, - List files, + IReadOnlyList files, CollectionType? collectionType) { if (collectionType == CollectionType.books) @@ -179,7 +179,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio var result = new MultiItemResolverResult { ExtraFiles = leftOver, - Items = new List() + Items = [] }; var isInMixedFolder = resolverResult.Count > 1 || (parent is not null && parent.IsTopParent); diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index b2ceee97d8..f57f5b9c8e 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -29,14 +29,14 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies { private readonly IImageProcessor _imageProcessor; - private static readonly CollectionType[] _validCollectionTypes = new[] - { + private static readonly CollectionType[] _validCollectionTypes = + [ CollectionType.movies, CollectionType.homevideos, CollectionType.musicvideos, CollectionType.tvshows, CollectionType.photos - }; + ]; /// /// Initializes a new instance of the class. @@ -63,7 +63,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies /// public MultiItemResolverResult ResolveMultiple( Folder parent, - List files, + IReadOnlyList files, CollectionType? collectionType, IDirectoryService directoryService) { @@ -187,7 +187,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies private MultiItemResolverResult ResolveMultipleInternal( Folder parent, - List files, + IReadOnlyList files, CollectionType? collectionType) { if (IsInvalid(parent, collectionType)) diff --git a/Emby.Server.Implementations/Library/UserDataManager.cs b/Emby.Server.Implementations/Library/UserDataManager.cs index be1d96bf0b..2fd5daea2a 100644 --- a/Emby.Server.Implementations/Library/UserDataManager.cs +++ b/Emby.Server.Implementations/Library/UserDataManager.cs @@ -83,7 +83,7 @@ namespace Emby.Server.Implementations.Library UserDataSaved?.Invoke(this, new UserDataSaveEventArgs { - Keys = keys, + Keys = keys.ToList(), UserData = userData, SaveReason = reason, UserId = user.Id, @@ -237,7 +237,7 @@ namespace Emby.Server.Implementations.Library /// public UserItemData? GetUserData(User user, BaseItem item) { - return GetUserData(user, item.Id, item.GetUserDataKeys()); + return GetUserData(user, item.Id, item.GetUserDataKeys().ToList()); } /// diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index cf2ca047cf..e37a1a183b 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -2051,7 +2051,7 @@ namespace Emby.Server.Implementations.Session } /// - public Task SendMessageToUserSessions(List userIds, SessionMessageType name, Func dataFn, CancellationToken cancellationToken) + public Task SendMessageToUserSessions(IEnumerable userIds, SessionMessageType name, Func dataFn, CancellationToken cancellationToken) { CheckDisposed(); @@ -2066,7 +2066,7 @@ namespace Emby.Server.Implementations.Session } /// - public Task SendMessageToUserSessions(List userIds, SessionMessageType name, T data, CancellationToken cancellationToken) + public Task SendMessageToUserSessions(IEnumerable userIds, SessionMessageType name, T data, CancellationToken cancellationToken) { CheckDisposed(); diff --git a/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs b/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs index b45d754554..1a0c2c3446 100644 --- a/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs +++ b/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs @@ -256,7 +256,7 @@ namespace Emby.Server.Implementations.SyncPlay } /// - public List ListGroups(SessionInfo session, ListGroupsRequest request) + public IReadOnlyList ListGroups(SessionInfo session, ListGroupsRequest request) { if (session is null) { diff --git a/Jellyfin.Api/Controllers/TvShowsController.cs b/Jellyfin.Api/Controllers/TvShowsController.cs index 0f08854d24..fd68353cad 100644 --- a/Jellyfin.Api/Controllers/TvShowsController.cs +++ b/Jellyfin.Api/Controllers/TvShowsController.cs @@ -243,7 +243,7 @@ public class TvShowsController : BaseJellyfinApiController return NotFound("No season exists with Id " + seasonId); } - episodes = seasonItem.GetEpisodes(user, dtoOptions, shouldIncludeMissingEpisodes); + episodes = seasonItem.GetEpisodes(user, dtoOptions, shouldIncludeMissingEpisodes).ToList(); } else if (season.HasValue) // Season number was supplied. Get episodes by season number { @@ -258,8 +258,8 @@ public class TvShowsController : BaseJellyfinApiController .FirstOrDefault(i => i.IndexNumber == season.Value); episodes = seasonItem is null ? - new List() - : ((Season)seasonItem).GetEpisodes(user, dtoOptions, shouldIncludeMissingEpisodes); + [] + : ((Season)seasonItem).GetEpisodes(user, dtoOptions, shouldIncludeMissingEpisodes).ToList(); } else // No season number or season id was supplied. Returning all episodes. { diff --git a/Jellyfin.Api/Helpers/StreamingHelpers.cs b/Jellyfin.Api/Helpers/StreamingHelpers.cs index 2601fa3be8..1f4dd0b03b 100644 --- a/Jellyfin.Api/Helpers/StreamingHelpers.cs +++ b/Jellyfin.Api/Helpers/StreamingHelpers.cs @@ -17,9 +17,7 @@ using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.Streaming; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Entities; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.HttpResults; using Microsoft.Net.Http.Headers; namespace Jellyfin.Api.Helpers; diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs index 52585c996a..98fd3d3b62 100644 --- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs +++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs @@ -494,8 +494,8 @@ public sealed class BaseItemRepository var topParent = item.GetTopParent(); - var userdataKey = item.GetUserDataKeys(); - var inheritedTags = item.GetInheritedTags(); + var userdataKey = item.GetUserDataKeys().ToList(); + var inheritedTags = item.GetInheritedTags().ToList(); tuples.Add((item, ancestorIds, topParent, userdataKey, inheritedTags)); } diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index 709d4b70c8..c05c5ec74e 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -97,9 +97,9 @@ namespace MediaBrowser.Controller.Entities.Audio + (IndexNumber is not null ? IndexNumber.Value.ToString("0000 - ", CultureInfo.InvariantCulture) : string.Empty) + Name; } - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); var songKey = IndexNumber.HasValue ? IndexNumber.Value.ToString("0000", CultureInfo.InvariantCulture) : string.Empty; diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index d016d8f62b..f7d642bdc0 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -96,9 +96,9 @@ namespace MediaBrowser.Controller.Entities.Audio return 1; } - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); var albumArtist = AlbumArtist; if (!string.IsNullOrEmpty(albumArtist)) diff --git a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs index 58841e5b78..f35f070e2a 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs @@ -124,9 +124,9 @@ namespace MediaBrowser.Controller.Entities.Audio await base.ValidateChildrenInternal(progress, recursive, refreshChildMetadata, false, refreshOptions, directoryService, cancellationToken).ConfigureAwait(false); } - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); list.InsertRange(0, GetUserDataKeys(this)); return list; diff --git a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs index 65669e6804..9c18406c95 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text.Json.Serialization; using Jellyfin.Data.Enums; using Jellyfin.Extensions; @@ -37,9 +38,9 @@ namespace MediaBrowser.Controller.Entities.Audio [JsonIgnore] public override bool SupportsPeople => false; - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics()); return list; diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 4efa3f410d..f928ff773f 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -811,7 +811,7 @@ namespace MediaBrowser.Controller.Entities return IsFileProtocol; } - public virtual bool IsAuthorizedToDelete(User user, List allCollectionFolders) + public virtual bool IsAuthorizedToDelete(User user, IReadOnlyList allCollectionFolders) { if (user.HasPermission(PermissionKind.EnableContentDeletion)) { @@ -844,7 +844,7 @@ namespace MediaBrowser.Controller.Entities return ownerId.IsEmpty() ? null : LibraryManager.GetItemById(ownerId); } - public bool CanDelete(User user, List allCollectionFolders) + public bool CanDelete(User user, IReadOnlyList allCollectionFolders) { return CanDelete() && IsAuthorizedToDelete(user, allCollectionFolders); } @@ -1435,7 +1435,7 @@ namespace MediaBrowser.Controller.Entities : false; } - public virtual List GetUserDataKeys() + public virtual IReadOnlyList GetUserDataKeys() { var list = new List(); @@ -1622,7 +1622,7 @@ namespace MediaBrowser.Controller.Entities return LocalizationManager.GetRatingScore(rating); } - public List GetInheritedTags() + public IReadOnlyList GetInheritedTags() { var list = new List(); list.AddRange(Tags); @@ -2175,7 +2175,7 @@ namespace MediaBrowser.Controller.Entities /// The images. /// true if images were added or updated, false otherwise. /// Cannot call AddImages with chapter images. - public bool AddImages(ImageType imageType, List images) + public bool AddImages(ImageType imageType, IReadOnlyList images) { if (imageType == ImageType.Chapter) { @@ -2251,7 +2251,7 @@ namespace MediaBrowser.Controller.Entities }.Concat(GetLocalMetadataFilesToDelete()); } - protected List GetLocalMetadataFilesToDelete() + protected IReadOnlyList GetLocalMetadataFilesToDelete() { if (IsFolder || !IsInMixedFolder) { @@ -2509,7 +2509,7 @@ namespace MediaBrowser.Controller.Entities return string.Join('|', list).GetMD5().ToString("N", CultureInfo.InvariantCulture); } - protected virtual List GetEtagValues(User user) + protected virtual IReadOnlyList GetEtagValues(User user) { return [ diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs index ca79e62454..d485b27167 100644 --- a/MediaBrowser.Controller/Entities/CollectionFolder.cs +++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs @@ -1,5 +1,6 @@ #nullable disable +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; diff --git a/MediaBrowser.Controller/Entities/Genre.cs b/MediaBrowser.Controller/Entities/Genre.cs index 6ec78a270e..f0fbc7fc12 100644 --- a/MediaBrowser.Controller/Entities/Genre.cs +++ b/MediaBrowser.Controller/Entities/Genre.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text.Json.Serialization; using Jellyfin.Data.Enums; using Jellyfin.Extensions; @@ -34,9 +35,9 @@ namespace MediaBrowser.Controller.Entities [JsonIgnore] public override bool SupportsPeople => false; - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics()); return list; diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs index dd5852823e..8e9e9e0317 100644 --- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs +++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs @@ -105,7 +105,7 @@ namespace MediaBrowser.Controller.Entities.Movies return []; } - public override bool IsAuthorizedToDelete(User user, List allCollectionFolders) + public override bool IsAuthorizedToDelete(User user, IReadOnlyList allCollectionFolders) { return user.HasPermission(PermissionKind.IsAdministrator) || user.HasPermission(PermissionKind.EnableCollectionManagement); } diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.cs index 5cc4d322f7..75946cbd8e 100644 --- a/MediaBrowser.Controller/Entities/Person.cs +++ b/MediaBrowser.Controller/Entities/Person.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text.Json.Serialization; using Jellyfin.Extensions; using MediaBrowser.Controller.Providers; @@ -37,9 +38,9 @@ namespace MediaBrowser.Controller.Entities [JsonIgnore] public override bool SupportsAncestors => false; - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics()); return list; diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.cs index 9103b09a95..621d9c4b18 100644 --- a/MediaBrowser.Controller/Entities/Studio.cs +++ b/MediaBrowser.Controller/Entities/Studio.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text.Json.Serialization; using Jellyfin.Extensions; using Microsoft.Extensions.Logging; @@ -33,9 +34,9 @@ namespace MediaBrowser.Controller.Entities [JsonIgnore] public override bool SupportsPeople => false; - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics()); return list; diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index 6bdba36f9c..b4d5bd51e9 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -155,14 +155,14 @@ namespace MediaBrowser.Controller.Entities.TV return 16.0 / 9; } - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); var series = Series; if (series is not null && ParentIndexNumber.HasValue && IndexNumber.HasValue) { - var seriesUserDataKeys = series.GetUserDataKeys(); + var seriesUserDataKeys = series.GetUserDataKeys().ToList(); var take = seriesUserDataKeys.Count; if (seriesUserDataKeys.Count > 1) { diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs index 408161b03d..b9ffd8eb4b 100644 --- a/MediaBrowser.Controller/Entities/TV/Season.cs +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -100,14 +100,14 @@ namespace MediaBrowser.Controller.Entities.TV return series is null ? SeriesName : series.SortName; } - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); var series = Series; if (series is not null) { - var newList = series.GetUserDataKeys(); + var newList = series.GetUserDataKeys().ToList(); var suffix = (IndexNumber ?? 0).ToString("000", CultureInfo.InvariantCulture); for (int i = 0; i < newList.Count; i++) { @@ -158,7 +158,7 @@ namespace MediaBrowser.Controller.Entities.TV try { query.Parent = this; - query.ChannelIds = new[] { ChannelId }; + query.ChannelIds = [ChannelId]; return ChannelManager.GetChannelItemsInternal(query, new Progress(), CancellationToken.None).GetAwaiter().GetResult(); } catch @@ -189,27 +189,27 @@ namespace MediaBrowser.Controller.Entities.TV /// The options to use. /// If missing episodes should be included. /// Set of episodes. - public List GetEpisodes(User user, DtoOptions options, bool shouldIncludeMissingEpisodes) + public IReadOnlyList GetEpisodes(User user, DtoOptions options, bool shouldIncludeMissingEpisodes) { return GetEpisodes(Series, user, options, shouldIncludeMissingEpisodes); } - public List GetEpisodes(Series series, User user, DtoOptions options, bool shouldIncludeMissingEpisodes) + public IReadOnlyList GetEpisodes(Series series, User user, DtoOptions options, bool shouldIncludeMissingEpisodes) { return GetEpisodes(series, user, null, options, shouldIncludeMissingEpisodes); } - public List GetEpisodes(Series series, User user, IEnumerable allSeriesEpisodes, DtoOptions options, bool shouldIncludeMissingEpisodes) + public IReadOnlyList GetEpisodes(Series series, User user, IEnumerable allSeriesEpisodes, DtoOptions options, bool shouldIncludeMissingEpisodes) { return series.GetSeasonEpisodes(this, user, allSeriesEpisodes, options, shouldIncludeMissingEpisodes); } - public List GetEpisodes() + public IReadOnlyList GetEpisodes() { return Series.GetSeasonEpisodes(this, null, null, new DtoOptions(true), true); } - public override List GetChildren(User user, bool includeLinkedChildren, InternalItemsQuery query) + public override IReadOnlyList GetChildren(User user, bool includeLinkedChildren, InternalItemsQuery query) { return GetEpisodes(user, new DtoOptions(true), true); } diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index 62c73d56f8..e68a83e5e7 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -1,5 +1,6 @@ #nullable disable +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -28,7 +29,7 @@ namespace MediaBrowser.Controller.Entities.TV { public Series() { - AirDays = Array.Empty(); + AirDays = []; } public DayOfWeek[] AirDays { get; set; } @@ -168,9 +169,9 @@ namespace MediaBrowser.Controller.Entities.TV /// Gets the user data key. /// /// System.String. - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); if (this.TryGetProviderId(MetadataProvider.Imdb, out var key)) { @@ -360,7 +361,7 @@ namespace MediaBrowser.Controller.Entities.TV await ProviderManager.RefreshSingleItem(this, refreshOptions, cancellationToken).ConfigureAwait(false); } - public List GetSeasonEpisodes(Season parentSeason, User user, DtoOptions options, bool shouldIncludeMissingEpisodes) + public IReadOnlyList GetSeasonEpisodes(Season parentSeason, User user, DtoOptions options, bool shouldIncludeMissingEpisodes) { var queryFromSeries = ConfigurationManager.Configuration.DisplaySpecialsWithinSeasons; @@ -406,7 +407,7 @@ namespace MediaBrowser.Controller.Entities.TV return GetSeasonEpisodes(parentSeason, user, allItems, options, shouldIncludeMissingEpisodes); } - public List GetSeasonEpisodes(Season parentSeason, User user, IEnumerable allSeriesEpisodes, DtoOptions options, bool shouldIncludeMissingEpisodes) + public IReadOnlyList GetSeasonEpisodes(Season parentSeason, User user, IEnumerable allSeriesEpisodes, DtoOptions options, bool shouldIncludeMissingEpisodes) { if (allSeriesEpisodes is null) { diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs index 1eb3c8f50f..e613400402 100644 --- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs +++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs @@ -990,7 +990,7 @@ namespace MediaBrowser.Controller.Entities return _userViewManager.GetUserSubView(parent.Id, type, localizationKey, sortName); } - public static IEnumerable FilterForAdjacency(List list, Guid adjacentTo) + public static IEnumerable FilterForAdjacency(IReadOnlyList list, Guid adjacentTo) { var adjacentToItem = list.FirstOrDefault(i => i.Id.Equals(adjacentTo)); diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index 04f47b729d..9a1dfbfe71 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -1,5 +1,6 @@ #nullable disable +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -259,9 +260,9 @@ namespace MediaBrowser.Controller.Entities [JsonIgnore] public override MediaType MediaType => MediaType.Video; - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); if (EnableDefaultVideoUserDataKeys) { diff --git a/MediaBrowser.Controller/Entities/Year.cs b/MediaBrowser.Controller/Entities/Year.cs index 37820296cc..886db9e7c5 100644 --- a/MediaBrowser.Controller/Entities/Year.cs +++ b/MediaBrowser.Controller/Entities/Year.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.Linq; using System.Text.Json.Serialization; using Microsoft.Extensions.Logging; @@ -35,9 +36,9 @@ namespace MediaBrowser.Controller.Entities return false; } - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); list.Insert(0, "Year-" + Name); return list; diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index b558ef73d5..cae45111be 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -1,10 +1,10 @@ #nullable disable +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; using System.Collections.Generic; -using System.Linq; using Jellyfin.Data.Enums; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Configuration; diff --git a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs index 52581df459..b72f978e17 100644 --- a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs @@ -1,5 +1,6 @@ #nullable disable +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using MediaBrowser.Model.LiveTv; diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs index 52fb156481..e9d5af8d1f 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs @@ -170,6 +170,6 @@ namespace MediaBrowser.Controller.LiveTv public interface ISupportsDirectStreamProvider { - Task GetChannelStreamWithDirectStreamProvider(string channelId, string streamId, List currentLiveStreams, CancellationToken cancellationToken); + Task GetChannelStreamWithDirectStreamProvider(string channelId, string streamId, IReadOnlyList currentLiveStreams, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/LiveTv/ITunerHost.cs b/MediaBrowser.Controller/LiveTv/ITunerHost.cs index 3689a2adf6..4a0a3cd5d9 100644 --- a/MediaBrowser.Controller/LiveTv/ITunerHost.cs +++ b/MediaBrowser.Controller/LiveTv/ITunerHost.cs @@ -43,7 +43,7 @@ namespace MediaBrowser.Controller.LiveTv /// The current live streams. /// The cancellation token to cancel operation. /// Live stream wrapped in a task. - Task GetChannelStream(string channelId, string streamId, IList currentLiveStreams, CancellationToken cancellationToken); + Task GetChannelStream(string channelId, string streamId, IReadOnlyList currentLiveStreams, CancellationToken cancellationToken); /// /// Gets the channel stream media sources. diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index b10e77e10a..dbb8277d5e 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -88,9 +88,9 @@ namespace MediaBrowser.Controller.LiveTv [JsonIgnore] public string EpisodeTitle { get; set; } - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); if (!ConfigurationManager.Configuration.DisableLiveTvChannelUserDataName) { diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 83944f741c..238f6f4662 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -162,9 +162,9 @@ namespace MediaBrowser.Controller.LiveTv [JsonIgnore] public override bool SupportsAncestors => false; - public override List GetUserDataKeys() + public override IReadOnlyList GetUserDataKeys() { - var list = base.GetUserDataKeys(); + var list = base.GetUserDataKeys().ToList(); if (!IsSeries) { diff --git a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs index 3c3ac2471f..61ed56cf7f 100644 --- a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs @@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.LiveTv { public ProgramInfo() { - Genres = new List(); + Genres = []; ProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase); SeriesProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase); @@ -65,7 +65,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// Gets or sets the genre of the program. /// - public List Genres { get; set; } + public IReadOnlyList Genres { get; set; } /// /// Gets or sets the original air date. diff --git a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs index d6811fe14e..e1c67d5c13 100644 --- a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs +++ b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs @@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.LiveTv { public SeriesTimerInfo() { - Days = new List(); + Days = []; SkipEpisodesInLibrary = true; KeepUntil = KeepUntil.UntilDeleted; } @@ -86,7 +86,7 @@ namespace MediaBrowser.Controller.LiveTv /// Gets or sets the days. /// /// The days. - public List Days { get; set; } + public IReadOnlyList Days { get; set; } /// /// Gets or sets the priority. diff --git a/MediaBrowser.Controller/LiveTv/TimerInfo.cs b/MediaBrowser.Controller/LiveTv/TimerInfo.cs index 62541ea8bf..463da65cc1 100644 --- a/MediaBrowser.Controller/LiveTv/TimerInfo.cs +++ b/MediaBrowser.Controller/LiveTv/TimerInfo.cs @@ -1,5 +1,6 @@ #nullable disable +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -14,11 +15,11 @@ namespace MediaBrowser.Controller.LiveTv { public TimerInfo() { - Genres = Array.Empty(); + Genres = []; KeepUntil = KeepUntil.UntilDeleted; ProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase); SeriesProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase); - Tags = Array.Empty(); + Tags = []; } public Dictionary ProviderIds { get; set; } diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs index 8d6211051b..be5e16bbe4 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs @@ -1,10 +1,10 @@ #nullable disable +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591, SA1401 using System; using System.Collections.Generic; -using System.ComponentModel; using System.Globalization; using System.Linq; using Jellyfin.Data.Enums; @@ -31,9 +31,9 @@ namespace MediaBrowser.Controller.MediaEncoding { TranscodingType = jobType; RemoteHttpHeaders = new Dictionary(StringComparer.OrdinalIgnoreCase); - SupportedAudioCodecs = Array.Empty(); - SupportedVideoCodecs = Array.Empty(); - SupportedSubtitleCodecs = Array.Empty(); + SupportedAudioCodecs = []; + SupportedVideoCodecs = []; + SupportedSubtitleCodecs = []; } public TranscodeReason TranscodeReasons @@ -599,7 +599,7 @@ namespace MediaBrowser.Controller.MediaEncoding } } - return Array.Empty(); + return []; } public string[] GetRequestedRangeTypes(string codec) @@ -619,7 +619,7 @@ namespace MediaBrowser.Controller.MediaEncoding } } - return Array.Empty(); + return []; } public string[] GetRequestedCodecTags(string codec) @@ -639,7 +639,7 @@ namespace MediaBrowser.Controller.MediaEncoding } } - return Array.Empty(); + return []; } public string GetRequestedLevel(string codec) diff --git a/MediaBrowser.Controller/Playlists/Playlist.cs b/MediaBrowser.Controller/Playlists/Playlist.cs index 1062399e3f..fa29bc20f4 100644 --- a/MediaBrowser.Controller/Playlists/Playlist.cs +++ b/MediaBrowser.Controller/Playlists/Playlist.cs @@ -118,7 +118,7 @@ namespace MediaBrowser.Controller.Playlists return 1; } - public override bool IsAuthorizedToDelete(User user, List allCollectionFolders) + public override bool IsAuthorizedToDelete(User user, IReadOnlyList allCollectionFolders) { return true; } diff --git a/MediaBrowser.Controller/Resolvers/IItemResolver.cs b/MediaBrowser.Controller/Resolvers/IItemResolver.cs index 0699734c4b..58ae89c3cb 100644 --- a/MediaBrowser.Controller/Resolvers/IItemResolver.cs +++ b/MediaBrowser.Controller/Resolvers/IItemResolver.cs @@ -1,3 +1,4 @@ +#pragma warning disable CA1002 // Do not expose generic lists #pragma warning disable CS1591 using System.Collections.Generic; @@ -32,7 +33,7 @@ namespace MediaBrowser.Controller.Resolvers { MultiItemResolverResult ResolveMultiple( Folder parent, - List files, + IReadOnlyList files, CollectionType? collectionType, IDirectoryService directoryService); } @@ -41,8 +42,8 @@ namespace MediaBrowser.Controller.Resolvers { public MultiItemResolverResult() { - Items = new List(); - ExtraFiles = new List(); + Items = []; + ExtraFiles = []; } public List Items { get; set; } diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index 2b3afa1174..e4a7e7afce 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -204,7 +204,7 @@ namespace MediaBrowser.Controller.Session /// The data. /// The cancellation token. /// Task. - Task SendMessageToUserSessions(List userIds, SessionMessageType name, T data, CancellationToken cancellationToken); + Task SendMessageToUserSessions(IEnumerable userIds, SessionMessageType name, T data, CancellationToken cancellationToken); /// /// Sends the message to user sessions. @@ -215,7 +215,7 @@ namespace MediaBrowser.Controller.Session /// Data function. /// The cancellation token. /// Task. - Task SendMessageToUserSessions(List userIds, SessionMessageType name, Func dataFn, CancellationToken cancellationToken); + Task SendMessageToUserSessions(IEnumerable userIds, SessionMessageType name, Func dataFn, CancellationToken cancellationToken); /// /// Sends the message to user device sessions. diff --git a/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs b/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs index ef052237af..d9601bee10 100644 --- a/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs +++ b/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs @@ -1,5 +1,6 @@ #nullable disable +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; diff --git a/MediaBrowser.Controller/SyncPlay/ISyncPlayManager.cs b/MediaBrowser.Controller/SyncPlay/ISyncPlayManager.cs index 6365a389eb..717bb8cead 100644 --- a/MediaBrowser.Controller/SyncPlay/ISyncPlayManager.cs +++ b/MediaBrowser.Controller/SyncPlay/ISyncPlayManager.cs @@ -45,7 +45,7 @@ namespace MediaBrowser.Controller.SyncPlay /// The session. /// The request. /// The list of available groups. - List ListGroups(SessionInfo session, ListGroupsRequest request); + IReadOnlyList ListGroups(SessionInfo session, ListGroupsRequest request); /// /// Gets available groups for a session by id. diff --git a/MediaBrowser.MediaEncoding/Transcoding/TranscodeManager.cs b/MediaBrowser.MediaEncoding/Transcoding/TranscodeManager.cs index 0cda803d64..26be978b34 100644 --- a/MediaBrowser.MediaEncoding/Transcoding/TranscodeManager.cs +++ b/MediaBrowser.MediaEncoding/Transcoding/TranscodeManager.cs @@ -15,7 +15,6 @@ using Jellyfin.Database.Implementations.Enums; using Jellyfin.Extensions; using MediaBrowser.Common; using MediaBrowser.Common.Configuration; -using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.MediaEncoding; diff --git a/MediaBrowser.Model/Channels/ChannelFeatures.cs b/MediaBrowser.Model/Channels/ChannelFeatures.cs index 1ca8e80a6f..d80f34a08a 100644 --- a/MediaBrowser.Model/Channels/ChannelFeatures.cs +++ b/MediaBrowser.Model/Channels/ChannelFeatures.cs @@ -1,89 +1,96 @@ -#pragma warning disable CS1591 +#pragma warning disable CA1819 // Properties should not return arrays using System; -namespace MediaBrowser.Model.Channels +namespace MediaBrowser.Model.Channels; + +/// +/// Channel Features. +/// +public class ChannelFeatures { - public class ChannelFeatures + /// + /// Initializes a new instance of the class. + /// + /// The name. + /// The id. + public ChannelFeatures(string name, Guid id) { - public ChannelFeatures(string name, Guid id) - { - MediaTypes = Array.Empty(); - ContentTypes = Array.Empty(); - DefaultSortFields = Array.Empty(); + MediaTypes = []; + ContentTypes = []; + DefaultSortFields = []; - Name = name; - Id = id; - } - - /// - /// Gets or sets the name. - /// - /// The name. - public string Name { get; set; } - - /// - /// Gets or sets the identifier. - /// - /// The identifier. - public Guid Id { get; set; } - - /// - /// Gets or sets a value indicating whether this instance can search. - /// - /// true if this instance can search; otherwise, false. - public bool CanSearch { get; set; } - - /// - /// Gets or sets the media types. - /// - /// The media types. - public ChannelMediaType[] MediaTypes { get; set; } - - /// - /// Gets or sets the content types. - /// - /// The content types. - public ChannelMediaContentType[] ContentTypes { get; set; } - - /// - /// Gets or sets the maximum number of records the channel allows retrieving at a time. - /// - public int? MaxPageSize { get; set; } - - /// - /// Gets or sets the automatic refresh levels. - /// - /// The automatic refresh levels. - public int? AutoRefreshLevels { get; set; } - - /// - /// Gets or sets the default sort orders. - /// - /// The default sort orders. - public ChannelItemSortField[] DefaultSortFields { get; set; } - - /// - /// Gets or sets a value indicating whether a sort ascending/descending toggle is supported. - /// - public bool SupportsSortOrderToggle { get; set; } - - /// - /// Gets or sets a value indicating whether [supports latest media]. - /// - /// true if [supports latest media]; otherwise, false. - public bool SupportsLatestMedia { get; set; } - - /// - /// Gets or sets a value indicating whether this instance can filter. - /// - /// true if this instance can filter; otherwise, false. - public bool CanFilter { get; set; } - - /// - /// Gets or sets a value indicating whether [supports content downloading]. - /// - /// true if [supports content downloading]; otherwise, false. - public bool SupportsContentDownloading { get; set; } + Name = name; + Id = id; } + + /// + /// Gets or sets the name. + /// + /// The name. + public string Name { get; set; } + + /// + /// Gets or sets the identifier. + /// + /// The identifier. + public Guid Id { get; set; } + + /// + /// Gets or sets a value indicating whether this instance can search. + /// + /// true if this instance can search; otherwise, false. + public bool CanSearch { get; set; } + + /// + /// Gets or sets the media types. + /// + /// The media types. + public ChannelMediaType[] MediaTypes { get; set; } + + /// + /// Gets or sets the content types. + /// + /// The content types. + public ChannelMediaContentType[] ContentTypes { get; set; } + + /// + /// Gets or sets the maximum number of records the channel allows retrieving at a time. + /// + public int? MaxPageSize { get; set; } + + /// + /// Gets or sets the automatic refresh levels. + /// + /// The automatic refresh levels. + public int? AutoRefreshLevels { get; set; } + + /// + /// Gets or sets the default sort orders. + /// + /// The default sort orders. + public ChannelItemSortField[] DefaultSortFields { get; set; } + + /// + /// Gets or sets a value indicating whether a sort ascending/descending toggle is supported. + /// + public bool SupportsSortOrderToggle { get; set; } + + /// + /// Gets or sets a value indicating whether [supports latest media]. + /// + /// true if [supports latest media]; otherwise, false. + public bool SupportsLatestMedia { get; set; } + + /// + /// Gets or sets a value indicating whether this instance can filter. + /// + /// true if this instance can filter; otherwise, false. + public bool CanFilter { get; set; } + + /// + /// Gets or sets a value indicating whether [supports content downloading]. + /// + /// true if [supports content downloading]; otherwise, false. + public bool SupportsContentDownloading { get; set; } } diff --git a/MediaBrowser.Model/Channels/ChannelQuery.cs b/MediaBrowser.Model/Channels/ChannelQuery.cs index f9380ce3a3..26748d3ee2 100644 --- a/MediaBrowser.Model/Channels/ChannelQuery.cs +++ b/MediaBrowser.Model/Channels/ChannelQuery.cs @@ -1,59 +1,86 @@ -#pragma warning disable CS1591 +#pragma warning disable CA1819 // Properties should not return arrays using System; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; -namespace MediaBrowser.Model.Channels +namespace MediaBrowser.Model.Channels; + +/// +/// Gets or sets the fields to return within the items, in addition to basic information. +/// +/// The fields. +public class ChannelQuery { - public class ChannelQuery - { - /// - /// Gets or sets the fields to return within the items, in addition to basic information. - /// - /// The fields. - public ItemFields[]? Fields { get; set; } + /// + /// Gets or sets the fields to return within the items, in addition to basic information. + /// + /// The fields. + public ItemFields[]? Fields { get; set; } - public bool? EnableImages { get; set; } + /// + /// Gets or sets a value indicating whether [enable images]. + /// + /// true if [enable images]; otherwise, false. + public bool? EnableImages { get; set; } - public int? ImageTypeLimit { get; set; } + /// + /// Gets or sets the image type limit. + /// + /// The image type limit. + public int? ImageTypeLimit { get; set; } - public ImageType[]? EnableImageTypes { get; set; } + /// + /// Gets or sets the enabled image types. + /// + /// The enabled image types. + public ImageType[]? EnableImageTypes { get; set; } - /// - /// Gets or sets the user identifier. - /// - /// The user identifier. - public Guid UserId { get; set; } + /// + /// Gets or sets the user identifier. + /// + /// The user identifier. + public Guid UserId { get; set; } - /// - /// Gets or sets the start index. Use for paging. - /// - /// The start index. - public int? StartIndex { get; set; } + /// + /// Gets or sets the start index. Use for paging. + /// + /// The start index. + public int? StartIndex { get; set; } - /// - /// Gets or sets the maximum number of items to return. - /// - /// The limit. - public int? Limit { get; set; } + /// + /// Gets or sets the maximum number of items to return. + /// + /// The limit. + public int? Limit { get; set; } - /// - /// Gets or sets a value indicating whether [supports latest items]. - /// - /// true if [supports latest items]; otherwise, false. - public bool? SupportsLatestItems { get; set; } + /// + /// Gets or sets a value indicating whether [supports latest items]. + /// + /// true if [supports latest items]; otherwise, false. + public bool? SupportsLatestItems { get; set; } - public bool? SupportsMediaDeletion { get; set; } + /// + /// Gets or sets a value indicating whether [supports media deletion]. + /// + /// true if [supports media deletion]; otherwise, false. + public bool? SupportsMediaDeletion { get; set; } - /// - /// Gets or sets a value indicating whether this instance is favorite. - /// - /// null if [is favorite] contains no value, true if [is favorite]; otherwise, false. - public bool? IsFavorite { get; set; } + /// + /// Gets or sets a value indicating whether this instance is favorite. + /// + /// null if [is favorite] contains no value, true if [is favorite]; otherwise, false. + public bool? IsFavorite { get; set; } - public bool? IsRecordingsFolder { get; set; } + /// + /// Gets or sets a value indicating whether this instance is a recording folder. + /// + /// true if [is recording folder]; otherwise, false. + public bool? IsRecordingsFolder { get; set; } - public bool RefreshLatestChannelItems { get; set; } - } + /// + /// Gets or sets a value indicating whether latest channel items should be refreshed. + /// + /// true if [refresh latest channel items]; otherwise, false. + public bool RefreshLatestChannelItems { get; set; } } diff --git a/MediaBrowser.Model/Configuration/LibraryOptions.cs b/MediaBrowser.Model/Configuration/LibraryOptions.cs index 590b74304d..aa0c32be15 100644 --- a/MediaBrowser.Model/Configuration/LibraryOptions.cs +++ b/MediaBrowser.Model/Configuration/LibraryOptions.cs @@ -1,8 +1,8 @@ +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; using System.ComponentModel; -using System.Linq; namespace MediaBrowser.Model.Configuration { @@ -12,14 +12,14 @@ namespace MediaBrowser.Model.Configuration public LibraryOptions() { - TypeOptions = Array.Empty(); - DisabledSubtitleFetchers = Array.Empty(); - DisabledMediaSegmentProviders = Array.Empty(); - MediaSegmentProviderOrder = Array.Empty(); - SubtitleFetcherOrder = Array.Empty(); - DisabledLocalMetadataReaders = Array.Empty(); - DisabledLyricFetchers = Array.Empty(); - LyricFetcherOrder = Array.Empty(); + TypeOptions = []; + DisabledSubtitleFetchers = []; + DisabledMediaSegmentProviders = []; + MediaSegmentProviderOrder = []; + SubtitleFetcherOrder = []; + DisabledLocalMetadataReaders = []; + DisabledLyricFetchers = []; + LyricFetcherOrder = []; SkipSubtitlesIfAudioTrackMatches = true; RequirePerfectSubtitleMatch = true; @@ -30,14 +30,14 @@ namespace MediaBrowser.Model.Configuration SaveSubtitlesWithMedia = true; SaveLyricsWithMedia = false; SaveTrickplayWithMedia = false; - PathInfos = Array.Empty(); + PathInfos = []; EnableAutomaticSeriesGrouping = true; SeasonZeroDisplayName = "Specials"; PreferNonstandardArtistsTag = false; UseCustomTagDelimiters = false; CustomTagDelimiters = _defaultTagDelimiters; - DelimiterWhitelist = Array.Empty(); + DelimiterWhitelist = []; } public bool Enabled { get; set; } = true; diff --git a/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs b/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs index aa07d66237..41b4607b02 100644 --- a/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs +++ b/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs @@ -1,7 +1,8 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 -using System; using MediaBrowser.Model.Entities; namespace MediaBrowser.Model.Configuration @@ -10,8 +11,8 @@ namespace MediaBrowser.Model.Configuration { public MetadataPluginSummary() { - SupportedImageTypes = Array.Empty(); - Plugins = Array.Empty(); + SupportedImageTypes = []; + Plugins = []; } /// diff --git a/MediaBrowser.Model/Configuration/TrickplayOptions.cs b/MediaBrowser.Model/Configuration/TrickplayOptions.cs index 578bb306a0..c007122a80 100644 --- a/MediaBrowser.Model/Configuration/TrickplayOptions.cs +++ b/MediaBrowser.Model/Configuration/TrickplayOptions.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +#pragma warning disable CA1819 // Properties should not return arrays + using System.Diagnostics; namespace MediaBrowser.Model.Configuration; @@ -11,18 +12,18 @@ public class TrickplayOptions /// /// Gets or sets a value indicating whether or not to use HW acceleration. /// - public bool EnableHwAcceleration { get; set; } = false; + public bool EnableHwAcceleration { get; set; } /// /// Gets or sets a value indicating whether or not to use HW accelerated MJPEG encoding. /// - public bool EnableHwEncoding { get; set; } = false; + public bool EnableHwEncoding { get; set; } /// /// Gets or sets a value indicating whether to only extract key frames. /// Significantly faster, but is not compatible with all decoders and/or video files. /// - public bool EnableKeyFrameOnlyExtraction { get; set; } = false; + public bool EnableKeyFrameOnlyExtraction { get; set; } /// /// Gets or sets the behavior used by trickplay provider on library scan/update. @@ -42,7 +43,7 @@ public class TrickplayOptions /// /// Gets or sets the target width resolutions, in px, to generates preview images for. /// - public int[] WidthResolutions { get; set; } = new[] { 320 }; + public int[] WidthResolutions { get; set; } = [320]; /// /// Gets or sets number of tile images to allow in X dimension. diff --git a/MediaBrowser.Model/Configuration/TypeOptions.cs b/MediaBrowser.Model/Configuration/TypeOptions.cs index d0179e5aab..6ea773e903 100644 --- a/MediaBrowser.Model/Configuration/TypeOptions.cs +++ b/MediaBrowser.Model/Configuration/TypeOptions.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -9,9 +11,9 @@ namespace MediaBrowser.Model.Configuration { public class TypeOptions { - public static readonly ImageOption DefaultInstance = new ImageOption(); + public static readonly ImageOption DefaultInstance = new(); - public static readonly Dictionary DefaultImageOptions = new Dictionary + public static readonly Dictionary DefaultImageOptions = new() { { "Movie", new[] @@ -304,11 +306,11 @@ namespace MediaBrowser.Model.Configuration public TypeOptions() { - MetadataFetchers = Array.Empty(); - MetadataFetcherOrder = Array.Empty(); - ImageFetchers = Array.Empty(); - ImageFetcherOrder = Array.Empty(); - ImageOptions = Array.Empty(); + MetadataFetchers = []; + MetadataFetcherOrder = []; + ImageFetchers = []; + ImageFetcherOrder = []; + ImageOptions = []; } public string Type { get; set; } diff --git a/MediaBrowser.Model/Configuration/UserConfiguration.cs b/MediaBrowser.Model/Configuration/UserConfiguration.cs index fe4b2de65f..7228d99e77 100644 --- a/MediaBrowser.Model/Configuration/UserConfiguration.cs +++ b/MediaBrowser.Model/Configuration/UserConfiguration.cs @@ -1,3 +1,4 @@ +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -22,10 +23,10 @@ namespace MediaBrowser.Model.Configuration HidePlayedInLatest = true; PlayDefaultAudioTrack = true; - LatestItemsExcludes = Array.Empty(); - OrderedViews = Array.Empty(); - MyMediaExcludes = Array.Empty(); - GroupedFolders = Array.Empty(); + LatestItemsExcludes = []; + OrderedViews = []; + MyMediaExcludes = []; + GroupedFolders = []; } /// diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs index da34eddcd1..7c18c4dafb 100644 --- a/MediaBrowser.Model/Dlna/CodecProfile.cs +++ b/MediaBrowser.Model/Dlna/CodecProfile.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA1819 // Properties should not return arrays + using System; using System.Collections.Generic; using System.Linq; diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs index 1b61bfe155..79ee683a2d 100644 --- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs +++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs @@ -324,7 +324,7 @@ namespace MediaBrowser.Model.Dlna return !condition.IsRequired; } - var expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true); + var expected = Enum.Parse(condition.Value, true); switch (condition.Condition) { diff --git a/MediaBrowser.Model/Dlna/MediaOptions.cs b/MediaBrowser.Model/Dlna/MediaOptions.cs index 6b26ca94b5..df112a2d1a 100644 --- a/MediaBrowser.Model/Dlna/MediaOptions.cs +++ b/MediaBrowser.Model/Dlna/MediaOptions.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA1819 // Properties should not return arrays + using System; using MediaBrowser.Model.Dto; @@ -62,7 +64,7 @@ namespace MediaBrowser.Model.Dlna /// /// Gets or sets the media sources. /// - public MediaSourceInfo[] MediaSources { get; set; } = Array.Empty(); + public MediaSourceInfo[] MediaSources { get; set; } = []; /// /// Gets or sets the device profile. diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 61e04a8134..321c462a90 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -2010,7 +2010,7 @@ namespace MediaBrowser.Model.Dlna } else if (condition.Condition == ProfileConditionType.NotEquals) { - item.SetOption(qualifier, "rangetype", string.Join(',', Enum.GetNames(typeof(VideoRangeType)).Except(values))); + item.SetOption(qualifier, "rangetype", string.Join(',', Enum.GetNames().Except(values))); } else if (condition.Condition == ProfileConditionType.EqualsAny) { diff --git a/MediaBrowser.Model/Dlna/TranscodingProfile.cs b/MediaBrowser.Model/Dlna/TranscodingProfile.cs index 5797d42506..7478c15015 100644 --- a/MediaBrowser.Model/Dlna/TranscodingProfile.cs +++ b/MediaBrowser.Model/Dlna/TranscodingProfile.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA1819 // Properties should not return arrays + using System; using System.ComponentModel; using System.Xml.Serialization; diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index 8f223c12a5..2be3c6fe5b 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -1,11 +1,12 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; using System.Collections.Generic; using System.ComponentModel; using Jellyfin.Data.Enums; -using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Library; @@ -563,7 +564,7 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the chapters. /// /// The chapters. - public List Chapters { get; set; } + public ChapterInfo[] Chapters { get; set; } /// /// Gets or sets the trickplay manifest. diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs index 75ccdcf276..c5d761aef7 100644 --- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs +++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System.Collections.Generic; diff --git a/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs b/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs index 6dd6653dc7..99f7642da0 100644 --- a/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs +++ b/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs @@ -1,3 +1,4 @@ +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -14,12 +15,12 @@ namespace MediaBrowser.Model.Entities /// public LibraryUpdateInfo() { - FoldersAddedTo = Array.Empty(); - FoldersRemovedFrom = Array.Empty(); - ItemsAdded = Array.Empty(); - ItemsRemoved = Array.Empty(); - ItemsUpdated = Array.Empty(); - CollectionFolders = Array.Empty(); + FoldersAddedTo = []; + FoldersRemovedFrom = []; + ItemsAdded = []; + ItemsRemoved = []; + ItemsUpdated = []; + CollectionFolders = []; } /// diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index 5c8f37fcdb..dc41c2b365 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -20,7 +20,9 @@ namespace MediaBrowser.Model.Entities /// /// Class MediaStream. /// +#pragma warning disable CA1711 // Identifiers should not have incorrect suffix public class MediaStream +#pragma warning restore CA1711 // Identifiers should not have incorrect suffix { private static readonly string[] _specialCodes = { diff --git a/MediaBrowser.Model/Entities/VirtualFolderInfo.cs b/MediaBrowser.Model/Entities/VirtualFolderInfo.cs index ea3df37265..1b635aab7e 100644 --- a/MediaBrowser.Model/Entities/VirtualFolderInfo.cs +++ b/MediaBrowser.Model/Entities/VirtualFolderInfo.cs @@ -1,7 +1,8 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 -using System; using MediaBrowser.Model.Configuration; namespace MediaBrowser.Model.Entities @@ -16,7 +17,7 @@ namespace MediaBrowser.Model.Entities /// public VirtualFolderInfo() { - Locations = Array.Empty(); + Locations = []; } /// diff --git a/MediaBrowser.Model/Library/UserViewQuery.cs b/MediaBrowser.Model/Library/UserViewQuery.cs index 01d5e3b6ca..292a81094c 100644 --- a/MediaBrowser.Model/Library/UserViewQuery.cs +++ b/MediaBrowser.Model/Library/UserViewQuery.cs @@ -1,3 +1,4 @@ +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -11,7 +12,7 @@ namespace MediaBrowser.Model.Library public UserViewQuery() { IncludeExternalContent = true; - PresetViews = Array.Empty(); + PresetViews = []; } /// diff --git a/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs b/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs index c6de4c1ab8..cd5c4814c5 100644 --- a/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; diff --git a/MediaBrowser.Model/LiveTv/ListingsProviderInfo.cs b/MediaBrowser.Model/LiveTv/ListingsProviderInfo.cs index 082daeb51b..b1e68251e6 100644 --- a/MediaBrowser.Model/LiveTv/ListingsProviderInfo.cs +++ b/MediaBrowser.Model/LiveTv/ListingsProviderInfo.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -10,13 +12,13 @@ namespace MediaBrowser.Model.LiveTv { public ListingsProviderInfo() { - NewsCategories = new[] { "news", "journalism", "documentary", "current affairs" }; - SportsCategories = new[] { "sports", "basketball", "baseball", "football" }; - KidsCategories = new[] { "kids", "family", "children", "childrens", "disney" }; - MovieCategories = new[] { "movie" }; - EnabledTuners = Array.Empty(); + NewsCategories = ["news", "journalism", "documentary", "current affairs"]; + SportsCategories = ["sports", "basketball", "baseball", "football"]; + KidsCategories = ["kids", "family", "children", "childrens", "disney"]; + MovieCategories = ["movie"]; + EnabledTuners = []; EnableAllTuners = true; - ChannelMappings = Array.Empty(); + ChannelMappings = []; } public string Id { get; set; } diff --git a/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs b/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs index 38e2731762..7dd829e174 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -15,7 +17,7 @@ namespace MediaBrowser.Model.LiveTv public LiveTvChannelQuery() { EnableUserData = true; - SortBy = Array.Empty(); + SortBy = []; } /// diff --git a/MediaBrowser.Model/LiveTv/LiveTvInfo.cs b/MediaBrowser.Model/LiveTv/LiveTvInfo.cs index 9767509d09..ba5a1fa7f4 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvInfo.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvInfo.cs @@ -1,15 +1,14 @@ +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 -using System; - namespace MediaBrowser.Model.LiveTv { public class LiveTvInfo { public LiveTvInfo() { - Services = Array.Empty(); - EnabledUsers = Array.Empty(); + Services = []; + EnabledUsers = []; } /// diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs index 25e5c77969..c0716a1b6a 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -9,9 +11,9 @@ namespace MediaBrowser.Model.LiveTv { public LiveTvOptions() { - TunerHosts = Array.Empty(); - ListingProviders = Array.Empty(); - MediaLocationsCreated = Array.Empty(); + TunerHosts = []; + ListingProviders = []; + MediaLocationsCreated = []; RecordingPostProcessorArguments = "\"{path}\""; } diff --git a/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs b/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs index ef5c5d2f31..f56ccc2231 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs @@ -1,7 +1,7 @@ #nullable disable -#pragma warning disable CS1591 -using System; +#pragma warning disable CA1819 // Properties should not return arrays +#pragma warning disable CS1591 namespace MediaBrowser.Model.LiveTv { @@ -12,7 +12,7 @@ namespace MediaBrowser.Model.LiveTv { public LiveTvServiceInfo() { - Tuners = Array.Empty(); + Tuners = []; } /// diff --git a/MediaBrowser.Model/LiveTv/RecordingQuery.cs b/MediaBrowser.Model/LiveTv/RecordingQuery.cs index 99bb1603c3..69cd82c6a0 100644 --- a/MediaBrowser.Model/LiveTv/RecordingQuery.cs +++ b/MediaBrowser.Model/LiveTv/RecordingQuery.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; diff --git a/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs b/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs index 1e8add9430..5ff4eb45fb 100644 --- a/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -22,8 +24,8 @@ namespace MediaBrowser.Model.LiveTv { public SeriesTimerInfoDto() { - ImageTags = new Dictionary(); - Days = Array.Empty(); + ImageTags = []; + Days = []; Type = "SeriesTimer"; } diff --git a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs index d546ffccdc..24dd236a1d 100644 --- a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs +++ b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs @@ -1,5 +1,6 @@ #nullable disable +using System.Collections.Generic; using MediaBrowser.Model.Entities; namespace MediaBrowser.Model.MediaInfo; @@ -13,7 +14,7 @@ public class BlurayDiscInfo /// Gets or sets the media streams. /// /// The media streams. - public MediaStream[] MediaStreams { get; set; } + public IReadOnlyList MediaStreams { get; set; } /// /// Gets or sets the run time ticks. @@ -25,7 +26,7 @@ public class BlurayDiscInfo /// Gets or sets the files. /// /// The files. - public string[] Files { get; set; } + public IReadOnlyList Files { get; set; } /// /// Gets or sets the playlist name. @@ -37,5 +38,5 @@ public class BlurayDiscInfo /// Gets or sets the chapters. /// /// The chapters. - public double[] Chapters { get; set; } + public IReadOnlyList Chapters { get; set; } } diff --git a/MediaBrowser.Model/MediaInfo/MediaInfo.cs b/MediaBrowser.Model/MediaInfo/MediaInfo.cs index 453aeb028a..4efc953c94 100644 --- a/MediaBrowser.Model/MediaInfo/MediaInfo.cs +++ b/MediaBrowser.Model/MediaInfo/MediaInfo.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -12,12 +14,12 @@ namespace MediaBrowser.Model.MediaInfo { public MediaInfo() { - Chapters = Array.Empty(); - Artists = Array.Empty(); - AlbumArtists = Array.Empty(); - Studios = Array.Empty(); - Genres = Array.Empty(); - People = Array.Empty(); + Chapters = []; + Artists = []; + AlbumArtists = []; + Studios = []; + Genres = []; + People = []; ProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase); } diff --git a/MediaBrowser.Model/Providers/ImageProviderInfo.cs b/MediaBrowser.Model/Providers/ImageProviderInfo.cs index 19af81c857..1541ccb364 100644 --- a/MediaBrowser.Model/Providers/ImageProviderInfo.cs +++ b/MediaBrowser.Model/Providers/ImageProviderInfo.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA1819 // Properties should not return arrays + using MediaBrowser.Model.Entities; namespace MediaBrowser.Model.Providers diff --git a/MediaBrowser.Model/Providers/RemoteImageResult.cs b/MediaBrowser.Model/Providers/RemoteImageResult.cs index e6067ee6ef..69d9aa223c 100644 --- a/MediaBrowser.Model/Providers/RemoteImageResult.cs +++ b/MediaBrowser.Model/Providers/RemoteImageResult.cs @@ -1,4 +1,7 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays + namespace MediaBrowser.Model.Providers { /// diff --git a/MediaBrowser.Model/Providers/RemoteSearchResult.cs b/MediaBrowser.Model/Providers/RemoteSearchResult.cs index a29e7ad1c5..12cea3ad13 100644 --- a/MediaBrowser.Model/Providers/RemoteSearchResult.cs +++ b/MediaBrowser.Model/Providers/RemoteSearchResult.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -12,7 +14,7 @@ namespace MediaBrowser.Model.Providers public RemoteSearchResult() { ProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase); - Artists = Array.Empty(); + Artists = []; } /// diff --git a/MediaBrowser.Model/Providers/SubtitleOptions.cs b/MediaBrowser.Model/Providers/SubtitleOptions.cs index 6ea1e14862..b412881a39 100644 --- a/MediaBrowser.Model/Providers/SubtitleOptions.cs +++ b/MediaBrowser.Model/Providers/SubtitleOptions.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -9,7 +11,7 @@ namespace MediaBrowser.Model.Providers { public SubtitleOptions() { - DownloadLanguages = Array.Empty(); + DownloadLanguages = []; SkipIfAudioTrackMatches = true; RequirePerfectMatch = true; diff --git a/MediaBrowser.Model/Querying/LatestItemsQuery.cs b/MediaBrowser.Model/Querying/LatestItemsQuery.cs index 40dc813978..ac2d0a1233 100644 --- a/MediaBrowser.Model/Querying/LatestItemsQuery.cs +++ b/MediaBrowser.Model/Querying/LatestItemsQuery.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -12,7 +14,7 @@ namespace MediaBrowser.Model.Querying { public LatestItemsQuery() { - EnableImageTypes = Array.Empty(); + EnableImageTypes = []; } /// diff --git a/MediaBrowser.Model/Querying/NextUpQuery.cs b/MediaBrowser.Model/Querying/NextUpQuery.cs index a2a3a9d1bb..2ad57c650d 100644 --- a/MediaBrowser.Model/Querying/NextUpQuery.cs +++ b/MediaBrowser.Model/Querying/NextUpQuery.cs @@ -1,3 +1,4 @@ +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -10,7 +11,7 @@ public class NextUpQuery { public NextUpQuery() { - EnableImageTypes = Array.Empty(); + EnableImageTypes = []; EnableTotalRecordCount = true; NextUpDateCutoff = DateTime.MinValue; EnableResumable = false; diff --git a/MediaBrowser.Model/Querying/QueryFilters.cs b/MediaBrowser.Model/Querying/QueryFilters.cs index 73b27a7b06..1359d27e2d 100644 --- a/MediaBrowser.Model/Querying/QueryFilters.cs +++ b/MediaBrowser.Model/Querying/QueryFilters.cs @@ -1,7 +1,8 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 -using System; using MediaBrowser.Model.Dto; namespace MediaBrowser.Model.Querying @@ -10,8 +11,8 @@ namespace MediaBrowser.Model.Querying { public QueryFilters() { - Tags = Array.Empty(); - Genres = Array.Empty(); + Tags = []; + Genres = []; } public NameGuidPair[] Genres { get; set; } diff --git a/MediaBrowser.Model/Querying/QueryFiltersLegacy.cs b/MediaBrowser.Model/Querying/QueryFiltersLegacy.cs index fcb450ed30..b28d7b7618 100644 --- a/MediaBrowser.Model/Querying/QueryFiltersLegacy.cs +++ b/MediaBrowser.Model/Querying/QueryFiltersLegacy.cs @@ -1,7 +1,7 @@ #nullable disable -#pragma warning disable CS1591 -using System; +#pragma warning disable CA1819 // Properties should not return arrays +#pragma warning disable CS1591 namespace MediaBrowser.Model.Querying { @@ -9,10 +9,10 @@ namespace MediaBrowser.Model.Querying { public QueryFiltersLegacy() { - Genres = Array.Empty(); - Tags = Array.Empty(); - OfficialRatings = Array.Empty(); - Years = Array.Empty(); + Genres = []; + Tags = []; + OfficialRatings = []; + Years = []; } public string[] Genres { get; set; } diff --git a/MediaBrowser.Model/Search/SearchQuery.cs b/MediaBrowser.Model/Search/SearchQuery.cs index 8126b8bfcc..add718a0b9 100644 --- a/MediaBrowser.Model/Search/SearchQuery.cs +++ b/MediaBrowser.Model/Search/SearchQuery.cs @@ -1,3 +1,4 @@ +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; @@ -15,9 +16,9 @@ namespace MediaBrowser.Model.Search IncludePeople = true; IncludeStudios = true; - MediaTypes = Array.Empty(); - IncludeItemTypes = Array.Empty(); - ExcludeItemTypes = Array.Empty(); + MediaTypes = []; + IncludeItemTypes = []; + ExcludeItemTypes = []; } /// diff --git a/MediaBrowser.Model/Session/PlayRequest.cs b/MediaBrowser.Model/Session/PlayRequest.cs index 6a66465a20..454633f2f6 100644 --- a/MediaBrowser.Model/Session/PlayRequest.cs +++ b/MediaBrowser.Model/Session/PlayRequest.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; diff --git a/MediaBrowser.Model/Session/PlaybackProgressInfo.cs b/MediaBrowser.Model/Session/PlaybackProgressInfo.cs index 04a9d68674..e3ff318bd8 100644 --- a/MediaBrowser.Model/Session/PlaybackProgressInfo.cs +++ b/MediaBrowser.Model/Session/PlaybackProgressInfo.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; diff --git a/MediaBrowser.Model/Session/PlaybackStopInfo.cs b/MediaBrowser.Model/Session/PlaybackStopInfo.cs index aa29bb249e..c2c30f0dd8 100644 --- a/MediaBrowser.Model/Session/PlaybackStopInfo.cs +++ b/MediaBrowser.Model/Session/PlaybackStopInfo.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; diff --git a/MediaBrowser.Model/Session/UserDataChangeInfo.cs b/MediaBrowser.Model/Session/UserDataChangeInfo.cs index ccd768da51..88d41bfe5a 100644 --- a/MediaBrowser.Model/Session/UserDataChangeInfo.cs +++ b/MediaBrowser.Model/Session/UserDataChangeInfo.cs @@ -1,23 +1,24 @@ +#pragma warning disable CA1819 // Properties should not return arrays + using System; using MediaBrowser.Model.Dto; -namespace MediaBrowser.Model.Session +namespace MediaBrowser.Model.Session; + +/// +/// Class UserDataChangeInfo. +/// +public class UserDataChangeInfo { /// - /// Class UserDataChangeInfo. + /// Gets or sets the user id. /// - public class UserDataChangeInfo - { - /// - /// Gets or sets the user id. - /// - /// The user id. - public Guid UserId { get; set; } + /// The user id. + public Guid UserId { get; set; } - /// - /// Gets or sets the user data list. - /// - /// The user data list. - public required UserItemDataDto[] UserDataList { get; set; } - } + /// + /// Gets or sets the user data list. + /// + /// The user data list. + public required UserItemDataDto[] UserDataList { get; set; } } diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs index 232a2a6bc8..78b1ab5605 100644 --- a/MediaBrowser.Model/System/SystemInfo.cs +++ b/MediaBrowser.Model/System/SystemInfo.cs @@ -1,4 +1,6 @@ #nullable disable + +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 using System; diff --git a/MediaBrowser.Model/Users/PinRedeemResult.cs b/MediaBrowser.Model/Users/PinRedeemResult.cs index 23fa631e86..962941a211 100644 --- a/MediaBrowser.Model/Users/PinRedeemResult.cs +++ b/MediaBrowser.Model/Users/PinRedeemResult.cs @@ -1,7 +1,6 @@ +#pragma warning disable CA1819 // Properties should not return arrays #pragma warning disable CS1591 -using System; - namespace MediaBrowser.Model.Users { public class PinRedeemResult @@ -16,6 +15,6 @@ namespace MediaBrowser.Model.Users /// Gets or sets the users reset. /// /// The users reset. - public string[] UsersReset { get; set; } = Array.Empty(); + public string[] UsersReset { get; set; } = []; } } diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs index d85f49b1d2..48e291151b 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs @@ -127,7 +127,7 @@ namespace MediaBrowser.Providers.MediaInfo blurayDiscInfo = GetBDInfo(item.Path); // Return if no playable .m2ts files are found - if (blurayDiscInfo is null || blurayDiscInfo.Files.Length == 0) + if (blurayDiscInfo is null || blurayDiscInfo.Files.Count == 0) { _logger.LogError("No playable .m2ts files found in Blu-ray structure, skipping FFprobe."); return ItemUpdateType.MetadataImport; @@ -343,9 +343,9 @@ namespace MediaBrowser.Providers.MediaInfo if (blurayInfo.Chapters is not null) { - double[] brChapter = blurayInfo.Chapters; - chapters = new ChapterInfo[brChapter.Length]; - for (int i = 0; i < brChapter.Length; i++) + var brChapter = blurayInfo.Chapters; + chapters = new ChapterInfo[brChapter.Count]; + for (int i = 0; i < brChapter.Count; i++) { chapters[i] = new ChapterInfo { diff --git a/src/Jellyfin.LiveTv/DefaultLiveTvService.cs b/src/Jellyfin.LiveTv/DefaultLiveTvService.cs index d8f873abe6..dc8b4c7f59 100644 --- a/src/Jellyfin.LiveTv/DefaultLiveTvService.cs +++ b/src/Jellyfin.LiveTv/DefaultLiveTvService.cs @@ -459,7 +459,7 @@ namespace Jellyfin.LiveTv throw new NotImplementedException(); } - public async Task GetChannelStreamWithDirectStreamProvider(string channelId, string streamId, List currentLiveStreams, CancellationToken cancellationToken) + public async Task GetChannelStreamWithDirectStreamProvider(string channelId, string streamId, IReadOnlyList currentLiveStreams, CancellationToken cancellationToken) { _logger.LogInformation("Streaming Channel {Id}", channelId); diff --git a/src/Jellyfin.LiveTv/TunerHosts/BaseTunerHost.cs b/src/Jellyfin.LiveTv/TunerHosts/BaseTunerHost.cs index aba9627ba0..3230c9fa45 100644 --- a/src/Jellyfin.LiveTv/TunerHosts/BaseTunerHost.cs +++ b/src/Jellyfin.LiveTv/TunerHosts/BaseTunerHost.cs @@ -166,9 +166,9 @@ namespace Jellyfin.LiveTv.TunerHosts return new List(); } - protected abstract Task GetChannelStream(TunerHostInfo tunerHost, ChannelInfo channel, string streamId, IList currentLiveStreams, CancellationToken cancellationToken); + protected abstract Task GetChannelStream(TunerHostInfo tunerHost, ChannelInfo channel, string streamId, IReadOnlyList currentLiveStreams, CancellationToken cancellationToken); - public async Task GetChannelStream(string channelId, string streamId, IList currentLiveStreams, CancellationToken cancellationToken) + public async Task GetChannelStream(string channelId, string streamId, IReadOnlyList currentLiveStreams, CancellationToken cancellationToken) { ArgumentException.ThrowIfNullOrEmpty(channelId); diff --git a/src/Jellyfin.LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/src/Jellyfin.LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs index e1f87a7bd4..692515aac7 100644 --- a/src/Jellyfin.LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs +++ b/src/Jellyfin.LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs @@ -40,7 +40,7 @@ namespace Jellyfin.LiveTv.TunerHosts.HdHomerun private readonly JsonSerializerOptions _jsonOptions; - private readonly Dictionary _modelCache = new Dictionary(); + private readonly Dictionary _modelCache = []; public HdHomerunHost( IServerConfigurationManager config, @@ -382,7 +382,7 @@ namespace Jellyfin.LiveTv.TunerHosts.HdHomerun return list; } - protected override async Task GetChannelStream(TunerHostInfo tunerHost, ChannelInfo channel, string streamId, IList currentLiveStreams, CancellationToken cancellationToken) + protected override async Task GetChannelStream(TunerHostInfo tunerHost, ChannelInfo channel, string streamId, IReadOnlyList currentLiveStreams, CancellationToken cancellationToken) { var tunerCount = tunerHost.TunerCount; diff --git a/src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs b/src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs index fb606be0ef..05f5d48e7b 100644 --- a/src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs +++ b/src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs @@ -75,7 +75,7 @@ namespace Jellyfin.LiveTv.TunerHosts .ConfigureAwait(false); } - protected override async Task GetChannelStream(TunerHostInfo tunerHost, ChannelInfo channel, string streamId, IList currentLiveStreams, CancellationToken cancellationToken) + protected override async Task GetChannelStream(TunerHostInfo tunerHost, ChannelInfo channel, string streamId, IReadOnlyList currentLiveStreams, CancellationToken cancellationToken) { var tunerCount = tunerHost.TunerCount;