Cleanup compiler warnings

This commit is contained in:
Shadowghost 2025-06-27 09:45:18 +02:00
parent 4f6db1bc22
commit aedff435ad
95 changed files with 507 additions and 404 deletions

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace Emby.Naming.Common namespace Emby.Naming.Common
@ -60,7 +61,7 @@ namespace Emby.Naming.Common
/// <summary> /// <summary>
/// Gets or sets optional list of date formats used for date parsing. /// Gets or sets optional list of date formats used for date parsing.
/// </summary> /// </summary>
public string[] DateTimeFormats { get; set; } public IReadOnlyList<string> DateTimeFormats { get; set; }
/// <summary> /// <summary>
/// Gets a <see cref="Regex"/> expressions objects (creates it if null). /// Gets a <see cref="Regex"/> expressions objects (creates it if null).

View File

@ -21,8 +21,8 @@ namespace Emby.Naming.Common
/// </summary> /// </summary>
public NamingOptions() public NamingOptions()
{ {
VideoFileExtensions = new[] VideoFileExtensions =
{ [
".001", ".001",
".3g2", ".3g2",
".3gp", ".3gp",
@ -77,10 +77,10 @@ namespace Emby.Naming.Common
".wmv", ".wmv",
".wtv", ".wtv",
".xvid" ".xvid"
}; ];
VideoFlagDelimiters = new[] VideoFlagDelimiters =
{ [
'(', '(',
')', ')',
'-', '-',
@ -88,15 +88,15 @@ namespace Emby.Naming.Common
'_', '_',
'[', '[',
']' ']'
}; ];
StubFileExtensions = new[] StubFileExtensions =
{ [
".disc" ".disc"
}; ];
StubTypes = new[] StubTypes =
{ [
new StubTypeRule( new StubTypeRule(
stubType: "dvd", stubType: "dvd",
token: "dvd"), token: "dvd"),
@ -136,32 +136,32 @@ namespace Emby.Naming.Common
new StubTypeRule( new StubTypeRule(
stubType: "tv", stubType: "tv",
token: "DSR") token: "DSR")
}; ];
VideoFileStackingRules = new[] VideoFileStackingRules =
{ [
new FileStackRule(@"^(?<filename>.*?)(?:(?<=[\]\)\}])|[ _.-]+)[\(\[]?(?<parttype>cd|dvd|part|pt|dis[ck])[ _.-]*(?<number>[0-9]+)[\)\]]?(?:\.[^.]+)?$", true), new FileStackRule(@"^(?<filename>.*?)(?:(?<=[\]\)\}])|[ _.-]+)[\(\[]?(?<parttype>cd|dvd|part|pt|dis[ck])[ _.-]*(?<number>[0-9]+)[\)\]]?(?:\.[^.]+)?$", true),
new FileStackRule(@"^(?<filename>.*?)(?:(?<=[\]\)\}])|[ _.-]+)[\(\[]?(?<parttype>cd|dvd|part|pt|dis[ck])[ _.-]*(?<number>[a-d])[\)\]]?(?:\.[^.]+)?$", false) new FileStackRule(@"^(?<filename>.*?)(?:(?<=[\]\)\}])|[ _.-]+)[\(\[]?(?<parttype>cd|dvd|part|pt|dis[ck])[ _.-]*(?<number>[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})*",
@"(.+[^_\,\.\(\)\[\]\-])[ _\.\(\)\[\]\-]+(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*(?<cleaned>.+?)[ _\,\.\(\)\[\]\-](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*(?<cleaned>.+?)[ _\,\.\(\)\[\]\-](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|\[.*\])([ _\,\.\(\)\[\]\-]|$)",
@"^(?<cleaned>.+?)(\[.*\])", @"^(?<cleaned>.+?)(\[.*\])",
@"^\s*(?<cleaned>.+?)\WE[0-9]+(-|~)E?[0-9]+(\W|$)", @"^\s*(?<cleaned>.+?)\WE[0-9]+(-|~)E?[0-9]+(\W|$)",
@"^\s*\[[^\]]+\](?!\.\w+$)\s*(?<cleaned>.+)", @"^\s*\[[^\]]+\](?!\.\w+$)\s*(?<cleaned>.+)",
@"^\s*(?<cleaned>.+?)\s+-\s+[0-9]+\s*$", @"^\s*(?<cleaned>.+?)\s+-\s+[0-9]+\s*$",
@"^\s*(?<cleaned>.+?)(([-._ ](trailer|sample))|-(scene|clip|behindthescenes|deleted|deletedscene|featurette|short|interview|other|extra))$" @"^\s*(?<cleaned>.+?)(([-._ ](trailer|sample))|-(scene|clip|behindthescenes|deleted|deletedscene|featurette|short|interview|other|extra))$"
}; ];
SubtitleFileExtensions = new[] SubtitleFileExtensions =
{ [
".ass", ".ass",
".mks", ".mks",
".sami", ".sami",
@ -171,17 +171,17 @@ namespace Emby.Naming.Common
".sub", ".sub",
".sup", ".sup",
".vtt", ".vtt",
}; ];
LyricFileExtensions = new[] LyricFileExtensions =
{ [
".lrc", ".lrc",
".elrc", ".elrc",
".txt" ".txt"
}; ];
AlbumStackingPrefixes = new[] AlbumStackingPrefixes =
{ [
"cd", "cd",
"digital media", "digital media",
"disc", "disc",
@ -190,10 +190,10 @@ namespace Emby.Naming.Common
"volume", "volume",
"part", "part",
"act" "act"
}; ];
ArtistSubfolders = new[] ArtistSubfolders =
{ [
"albums", "albums",
"broadcasts", "broadcasts",
"bootlegs", "bootlegs",
@ -208,10 +208,10 @@ namespace Emby.Naming.Common
"soundtracks", "soundtracks",
"spokenwords", "spokenwords",
"streets" "streets"
}; ];
AudioFileExtensions = new[] AudioFileExtensions =
{ [
".669", ".669",
".3gp", ".3gp",
".aa", ".aa",
@ -291,33 +291,33 @@ namespace Emby.Naming.Common
".xm", ".xm",
".xsp", ".xsp",
".ymf" ".ymf"
}; ];
MediaFlagDelimiters = new[] MediaFlagDelimiters =
{ [
'.' '.'
}; ];
MediaForcedFlags = new[] MediaForcedFlags =
{ [
"foreign", "foreign",
"forced" "forced"
}; ];
MediaDefaultFlags = new[] MediaDefaultFlags =
{ [
"default" "default"
}; ];
MediaHearingImpairedFlags = new[] MediaHearingImpairedFlags =
{ [
"cc", "cc",
"hi", "hi",
"sdh" "sdh"
}; ];
EpisodeExpressions = new[] EpisodeExpressions =
{ [
// *** Begin Kodi Standard Naming // *** Begin Kodi Standard Naming
// <!-- foo.s01.e01, foo.s01_e01, S01E02 foo, S01 - E02 --> // <!-- foo.s01.e01, foo.s01_e01, S01E02 foo, S01 - E02 -->
new EpisodeExpression(@".*(\\|\/)(?<seriesname>((?![Ss]([0-9]+)[][ ._-]*[Ee]([0-9]+))[^\\\/])*)?[Ss](?<seasonnumber>[0-9]+)[][ ._-]*[Ee](?<epnumber>[0-9]+)([^\\/]*)$") new EpisodeExpression(@".*(\\|\/)(?<seriesname>((?![Ss]([0-9]+)[][ ._-]*[Ee]([0-9]+))[^\\\/])*)?[Ss](?<seasonnumber>[0-9]+)[][ ._-]*[Ee](?<epnumber>[0-9]+)([^\\/]*)$")
@ -330,23 +330,23 @@ namespace Emby.Naming.Common
new EpisodeExpression(@"[^\\/]*?()\.?[Ee]([0-9]+)\.([^\\/]*)$"), new EpisodeExpression(@"[^\\/]*?()\.?[Ee]([0-9]+)\.([^\\/]*)$"),
new EpisodeExpression("(?<year>[0-9]{4})[._ -](?<month>[0-9]{2})[._ -](?<day>[0-9]{2})", true) new EpisodeExpression("(?<year>[0-9]{4})[._ -](?<month>[0-9]{2})[._ -](?<day>[0-9]{2})", true)
{ {
DateTimeFormats = new[] DateTimeFormats =
{ [
"yyyy.MM.dd", "yyyy.MM.dd",
"yyyy-MM-dd", "yyyy-MM-dd",
"yyyy_MM_dd", "yyyy_MM_dd",
"yyyy MM dd" "yyyy MM dd"
} ]
}, },
new EpisodeExpression("(?<day>[0-9]{2})[._ -](?<month>[0-9]{2})[._ -](?<year>[0-9]{4})", true) new EpisodeExpression("(?<day>[0-9]{2})[._ -](?<month>[0-9]{2})[._ -](?<year>[0-9]{4})", true)
{ {
DateTimeFormats = new[] DateTimeFormats =
{ [
"dd.MM.yyyy", "dd.MM.yyyy",
"dd-MM-yyyy", "dd-MM-yyyy",
"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 // 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 IsNamed = true
}, },
}; ];
VideoExtraRules = new[] VideoExtraRules =
{ [
new ExtraRule( new ExtraRule(
ExtraType.Trailer, ExtraType.Trailer,
ExtraRuleType.DirectoryName, ExtraRuleType.DirectoryName,
@ -691,14 +691,14 @@ namespace Emby.Naming.Common
ExtraRuleType.Suffix, ExtraRuleType.Suffix,
"-other", "-other",
MediaType.Video) MediaType.Video)
}; ];
AllExtrasTypesFolderNames = VideoExtraRules AllExtrasTypesFolderNames = VideoExtraRules
.Where(i => i.RuleType == ExtraRuleType.DirectoryName) .Where(i => i.RuleType == ExtraRuleType.DirectoryName)
.ToDictionary(i => i.Token, i => i.ExtraType, StringComparer.OrdinalIgnoreCase); .ToDictionary(i => i.Token, i => i.ExtraType, StringComparer.OrdinalIgnoreCase);
Format3DRules = new[] Format3DRules =
{ [
// Kodi rules: // Kodi rules:
new Format3DRule( new Format3DRule(
precedingToken: "3d", precedingToken: "3d",
@ -725,10 +725,10 @@ namespace Emby.Naming.Common
new Format3DRule("tab"), new Format3DRule("tab"),
new Format3DRule("sbs3d"), new Format3DRule("sbs3d"),
new Format3DRule("mvc") new Format3DRule("mvc")
}; ];
AudioBookPartsExpressions = new[] AudioBookPartsExpressions =
{ [
// Detect specified chapters, like CH 01 // Detect specified chapters, like CH 01
@"ch(?:apter)?[\s_-]?(?<chapter>[0-9]+)", @"ch(?:apter)?[\s_-]?(?<chapter>[0-9]+)",
// Detect specified parts, like Part 02 // Detect specified parts, like Part 02
@ -741,14 +741,14 @@ namespace Emby.Naming.Common
"(?<chapter>[0-9]+)_(?<part>[0-9]+)", "(?<chapter>[0-9]+)_(?<part>[0-9]+)",
// Some audiobooks are ripped from cd's, and will be named by disk number. // Some audiobooks are ripped from cd's, and will be named by disk number.
@"dis(?:c|k)[\s_-]?(?<chapter>[0-9]+)" @"dis(?:c|k)[\s_-]?(?<chapter>[0-9]+)"
}; ];
AudioBookNamesExpressions = new[] AudioBookNamesExpressions =
{ [
// Detect year usually in brackets after name Batman (2020) // Detect year usually in brackets after name Batman (2020)
@"^(?<name>.+?)\s*\(\s*(?<year>[0-9]{4})\s*\)\s*$", @"^(?<name>.+?)\s*\(\s*(?<year>[0-9]{4})\s*\)\s*$",
@"^\s*(?<name>[^ ].*?)\s*$" @"^\s*(?<name>[^ ].*?)\s*$"
}; ];
MultipleEpisodeExpressions = new[] MultipleEpisodeExpressions = new[]
{ {

View File

@ -110,11 +110,11 @@ namespace Emby.Naming.TV
if (expression.IsByDate) if (expression.IsByDate)
{ {
DateTime date; DateTime date;
if (expression.DateTimeFormats.Length > 0) if (expression.DateTimeFormats.Count > 0)
{ {
if (DateTime.TryParseExact( if (DateTime.TryParseExact(
match.Groups[0].ValueSpan, match.Groups[0].ValueSpan,
expression.DateTimeFormats, expression.DateTimeFormats.ToArray(),
CultureInfo.InvariantCulture, CultureInfo.InvariantCulture,
DateTimeStyles.None, DateTimeStyles.None,
out date)) out date))

View File

@ -7,7 +7,9 @@ namespace Emby.Naming.Video
/// <summary> /// <summary>
/// Object holding list of files paths with additional information. /// Object holding list of files paths with additional information.
/// </summary> /// </summary>
#pragma warning disable CA1711 // Identifiers should not have incorrect suffix
public class FileStack public class FileStack
#pragma warning restore CA1711 // Identifiers should not have incorrect suffix
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="FileStack"/> class. /// Initializes a new instance of the <see cref="FileStack"/> class.

View File

@ -132,7 +132,7 @@ namespace Emby.Naming.Video
} }
} }
private class StackMetadata private sealed class StackMetadata
{ {
public StackMetadata(bool isDirectory, bool isNumerical, string partType) public StackMetadata(bool isDirectory, bool isNumerical, string partType)
{ {

View File

@ -121,7 +121,9 @@ namespace Emby.Server.Implementations
private readonly IConfiguration _startupConfig; private readonly IConfiguration _startupConfig;
private readonly IXmlSerializer _xmlSerializer; private readonly IXmlSerializer _xmlSerializer;
private readonly IStartupOptions _startupOptions; private readonly IStartupOptions _startupOptions;
#pragma warning disable CA2213 // Disposable fields should be disposed
private readonly PluginManager _pluginManager; private readonly PluginManager _pluginManager;
#pragma warning restore CA2213 // Disposable fields should be disposed
private List<Type> _creatingInstances; private List<Type> _creatingInstances;

View File

@ -1060,7 +1060,7 @@ namespace Emby.Server.Implementations.Dto
if (options.ContainsField(ItemFields.Chapters)) if (options.ContainsField(ItemFields.Chapters))
{ {
dto.Chapters = _chapterManager.GetChapters(item.Id).ToList(); dto.Chapters = _chapterManager.GetChapters(item.Id).ToArray();
} }
if (options.ContainsField(ItemFields.Trickplay)) if (options.ContainsField(ItemFields.Trickplay))

View File

@ -39,7 +39,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
public MultiItemResolverResult ResolveMultiple( public MultiItemResolverResult ResolveMultiple(
Folder parent, Folder parent,
List<FileSystemMetadata> files, IReadOnlyList<FileSystemMetadata> files,
CollectionType? collectionType, CollectionType? collectionType,
IDirectoryService directoryService) IDirectoryService directoryService)
{ {
@ -58,7 +58,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
private MultiItemResolverResult ResolveMultipleInternal( private MultiItemResolverResult ResolveMultipleInternal(
Folder parent, Folder parent,
List<FileSystemMetadata> files, IReadOnlyList<FileSystemMetadata> files,
CollectionType? collectionType) CollectionType? collectionType)
{ {
if (collectionType == CollectionType.books) if (collectionType == CollectionType.books)
@ -179,7 +179,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
var result = new MultiItemResolverResult var result = new MultiItemResolverResult
{ {
ExtraFiles = leftOver, ExtraFiles = leftOver,
Items = new List<BaseItem>() Items = []
}; };
var isInMixedFolder = resolverResult.Count > 1 || (parent is not null && parent.IsTopParent); var isInMixedFolder = resolverResult.Count > 1 || (parent is not null && parent.IsTopParent);

View File

@ -29,14 +29,14 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
{ {
private readonly IImageProcessor _imageProcessor; private readonly IImageProcessor _imageProcessor;
private static readonly CollectionType[] _validCollectionTypes = new[] private static readonly CollectionType[] _validCollectionTypes =
{ [
CollectionType.movies, CollectionType.movies,
CollectionType.homevideos, CollectionType.homevideos,
CollectionType.musicvideos, CollectionType.musicvideos,
CollectionType.tvshows, CollectionType.tvshows,
CollectionType.photos CollectionType.photos
}; ];
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="MovieResolver"/> class. /// Initializes a new instance of the <see cref="MovieResolver"/> class.
@ -63,7 +63,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
/// <inheritdoc /> /// <inheritdoc />
public MultiItemResolverResult ResolveMultiple( public MultiItemResolverResult ResolveMultiple(
Folder parent, Folder parent,
List<FileSystemMetadata> files, IReadOnlyList<FileSystemMetadata> files,
CollectionType? collectionType, CollectionType? collectionType,
IDirectoryService directoryService) IDirectoryService directoryService)
{ {
@ -187,7 +187,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
private MultiItemResolverResult ResolveMultipleInternal( private MultiItemResolverResult ResolveMultipleInternal(
Folder parent, Folder parent,
List<FileSystemMetadata> files, IReadOnlyList<FileSystemMetadata> files,
CollectionType? collectionType) CollectionType? collectionType)
{ {
if (IsInvalid(parent, collectionType)) if (IsInvalid(parent, collectionType))

View File

@ -83,7 +83,7 @@ namespace Emby.Server.Implementations.Library
UserDataSaved?.Invoke(this, new UserDataSaveEventArgs UserDataSaved?.Invoke(this, new UserDataSaveEventArgs
{ {
Keys = keys, Keys = keys.ToList(),
UserData = userData, UserData = userData,
SaveReason = reason, SaveReason = reason,
UserId = user.Id, UserId = user.Id,
@ -237,7 +237,7 @@ namespace Emby.Server.Implementations.Library
/// <inheritdoc /> /// <inheritdoc />
public UserItemData? GetUserData(User user, BaseItem item) public UserItemData? GetUserData(User user, BaseItem item)
{ {
return GetUserData(user, item.Id, item.GetUserDataKeys()); return GetUserData(user, item.Id, item.GetUserDataKeys().ToList());
} }
/// <inheritdoc /> /// <inheritdoc />

View File

@ -2051,7 +2051,7 @@ namespace Emby.Server.Implementations.Session
} }
/// <inheritdoc /> /// <inheritdoc />
public Task SendMessageToUserSessions<T>(List<Guid> userIds, SessionMessageType name, Func<T> dataFn, CancellationToken cancellationToken) public Task SendMessageToUserSessions<T>(IEnumerable<Guid> userIds, SessionMessageType name, Func<T> dataFn, CancellationToken cancellationToken)
{ {
CheckDisposed(); CheckDisposed();
@ -2066,7 +2066,7 @@ namespace Emby.Server.Implementations.Session
} }
/// <inheritdoc /> /// <inheritdoc />
public Task SendMessageToUserSessions<T>(List<Guid> userIds, SessionMessageType name, T data, CancellationToken cancellationToken) public Task SendMessageToUserSessions<T>(IEnumerable<Guid> userIds, SessionMessageType name, T data, CancellationToken cancellationToken)
{ {
CheckDisposed(); CheckDisposed();

View File

@ -256,7 +256,7 @@ namespace Emby.Server.Implementations.SyncPlay
} }
/// <inheritdoc /> /// <inheritdoc />
public List<GroupInfoDto> ListGroups(SessionInfo session, ListGroupsRequest request) public IReadOnlyList<GroupInfoDto> ListGroups(SessionInfo session, ListGroupsRequest request)
{ {
if (session is null) if (session is null)
{ {

View File

@ -243,7 +243,7 @@ public class TvShowsController : BaseJellyfinApiController
return NotFound("No season exists with Id " + seasonId); 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 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); .FirstOrDefault(i => i.IndexNumber == season.Value);
episodes = seasonItem is null ? episodes = seasonItem is null ?
new List<BaseItem>() []
: ((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. else // No season number or season id was supplied. Returning all episodes.
{ {

View File

@ -17,9 +17,7 @@ using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Streaming; using MediaBrowser.Controller.Streaming;
using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;
namespace Jellyfin.Api.Helpers; namespace Jellyfin.Api.Helpers;

View File

@ -494,8 +494,8 @@ public sealed class BaseItemRepository
var topParent = item.GetTopParent(); var topParent = item.GetTopParent();
var userdataKey = item.GetUserDataKeys(); var userdataKey = item.GetUserDataKeys().ToList();
var inheritedTags = item.GetInheritedTags(); var inheritedTags = item.GetInheritedTags().ToList();
tuples.Add((item, ancestorIds, topParent, userdataKey, inheritedTags)); tuples.Add((item, ancestorIds, topParent, userdataKey, inheritedTags));
} }

View File

@ -97,9 +97,9 @@ namespace MediaBrowser.Controller.Entities.Audio
+ (IndexNumber is not null ? IndexNumber.Value.ToString("0000 - ", CultureInfo.InvariantCulture) : string.Empty) + Name; + (IndexNumber is not null ? IndexNumber.Value.ToString("0000 - ", CultureInfo.InvariantCulture) : string.Empty) + Name;
} }
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
var songKey = IndexNumber.HasValue ? IndexNumber.Value.ToString("0000", CultureInfo.InvariantCulture) : string.Empty; var songKey = IndexNumber.HasValue ? IndexNumber.Value.ToString("0000", CultureInfo.InvariantCulture) : string.Empty;

View File

@ -96,9 +96,9 @@ namespace MediaBrowser.Controller.Entities.Audio
return 1; return 1;
} }
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
var albumArtist = AlbumArtist; var albumArtist = AlbumArtist;
if (!string.IsNullOrEmpty(albumArtist)) if (!string.IsNullOrEmpty(albumArtist))

View File

@ -124,9 +124,9 @@ namespace MediaBrowser.Controller.Entities.Audio
await base.ValidateChildrenInternal(progress, recursive, refreshChildMetadata, false, refreshOptions, directoryService, cancellationToken).ConfigureAwait(false); await base.ValidateChildrenInternal(progress, recursive, refreshChildMetadata, false, refreshOptions, directoryService, cancellationToken).ConfigureAwait(false);
} }
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
list.InsertRange(0, GetUserDataKeys(this)); list.InsertRange(0, GetUserDataKeys(this));
return list; return list;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using Jellyfin.Data.Enums; using Jellyfin.Data.Enums;
using Jellyfin.Extensions; using Jellyfin.Extensions;
@ -37,9 +38,9 @@ namespace MediaBrowser.Controller.Entities.Audio
[JsonIgnore] [JsonIgnore]
public override bool SupportsPeople => false; public override bool SupportsPeople => false;
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics()); list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics());
return list; return list;

View File

@ -811,7 +811,7 @@ namespace MediaBrowser.Controller.Entities
return IsFileProtocol; return IsFileProtocol;
} }
public virtual bool IsAuthorizedToDelete(User user, List<Folder> allCollectionFolders) public virtual bool IsAuthorizedToDelete(User user, IReadOnlyList<Folder> allCollectionFolders)
{ {
if (user.HasPermission(PermissionKind.EnableContentDeletion)) if (user.HasPermission(PermissionKind.EnableContentDeletion))
{ {
@ -844,7 +844,7 @@ namespace MediaBrowser.Controller.Entities
return ownerId.IsEmpty() ? null : LibraryManager.GetItemById(ownerId); return ownerId.IsEmpty() ? null : LibraryManager.GetItemById(ownerId);
} }
public bool CanDelete(User user, List<Folder> allCollectionFolders) public bool CanDelete(User user, IReadOnlyList<Folder> allCollectionFolders)
{ {
return CanDelete() && IsAuthorizedToDelete(user, allCollectionFolders); return CanDelete() && IsAuthorizedToDelete(user, allCollectionFolders);
} }
@ -1435,7 +1435,7 @@ namespace MediaBrowser.Controller.Entities
: false; : false;
} }
public virtual List<string> GetUserDataKeys() public virtual IReadOnlyList<string> GetUserDataKeys()
{ {
var list = new List<string>(); var list = new List<string>();
@ -1622,7 +1622,7 @@ namespace MediaBrowser.Controller.Entities
return LocalizationManager.GetRatingScore(rating); return LocalizationManager.GetRatingScore(rating);
} }
public List<string> GetInheritedTags() public IReadOnlyList<string> GetInheritedTags()
{ {
var list = new List<string>(); var list = new List<string>();
list.AddRange(Tags); list.AddRange(Tags);
@ -2175,7 +2175,7 @@ namespace MediaBrowser.Controller.Entities
/// <param name="images">The images.</param> /// <param name="images">The images.</param>
/// <returns><c>true</c> if images were added or updated, <c>false</c> otherwise.</returns> /// <returns><c>true</c> if images were added or updated, <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) public bool AddImages(ImageType imageType, IReadOnlyList<FileSystemMetadata> images)
{ {
if (imageType == ImageType.Chapter) if (imageType == ImageType.Chapter)
{ {
@ -2251,7 +2251,7 @@ namespace MediaBrowser.Controller.Entities
}.Concat(GetLocalMetadataFilesToDelete()); }.Concat(GetLocalMetadataFilesToDelete());
} }
protected List<FileSystemMetadata> GetLocalMetadataFilesToDelete() protected IReadOnlyList<FileSystemMetadata> GetLocalMetadataFilesToDelete()
{ {
if (IsFolder || !IsInMixedFolder) if (IsFolder || !IsInMixedFolder)
{ {
@ -2509,7 +2509,7 @@ namespace MediaBrowser.Controller.Entities
return string.Join('|', list).GetMD5().ToString("N", CultureInfo.InvariantCulture); return string.Join('|', list).GetMD5().ToString("N", CultureInfo.InvariantCulture);
} }
protected virtual List<string> GetEtagValues(User user) protected virtual IReadOnlyList<string> GetEtagValues(User user)
{ {
return return
[ [

View File

@ -1,5 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using Jellyfin.Data.Enums; using Jellyfin.Data.Enums;
using Jellyfin.Extensions; using Jellyfin.Extensions;
@ -34,9 +35,9 @@ namespace MediaBrowser.Controller.Entities
[JsonIgnore] [JsonIgnore]
public override bool SupportsPeople => false; public override bool SupportsPeople => false;
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics()); list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics());
return list; return list;

View File

@ -105,7 +105,7 @@ namespace MediaBrowser.Controller.Entities.Movies
return []; return [];
} }
public override bool IsAuthorizedToDelete(User user, List<Folder> allCollectionFolders) public override bool IsAuthorizedToDelete(User user, IReadOnlyList<Folder> allCollectionFolders)
{ {
return user.HasPermission(PermissionKind.IsAdministrator) || user.HasPermission(PermissionKind.EnableCollectionManagement); return user.HasPermission(PermissionKind.IsAdministrator) || user.HasPermission(PermissionKind.EnableCollectionManagement);
} }

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using Jellyfin.Extensions; using Jellyfin.Extensions;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
@ -37,9 +38,9 @@ namespace MediaBrowser.Controller.Entities
[JsonIgnore] [JsonIgnore]
public override bool SupportsAncestors => false; public override bool SupportsAncestors => false;
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics()); list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics());
return list; return list;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using Jellyfin.Extensions; using Jellyfin.Extensions;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -33,9 +34,9 @@ namespace MediaBrowser.Controller.Entities
[JsonIgnore] [JsonIgnore]
public override bool SupportsPeople => false; public override bool SupportsPeople => false;
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics()); list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics());
return list; return list;

View File

@ -155,14 +155,14 @@ namespace MediaBrowser.Controller.Entities.TV
return 16.0 / 9; return 16.0 / 9;
} }
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
var series = Series; var series = Series;
if (series is not null && ParentIndexNumber.HasValue && IndexNumber.HasValue) if (series is not null && ParentIndexNumber.HasValue && IndexNumber.HasValue)
{ {
var seriesUserDataKeys = series.GetUserDataKeys(); var seriesUserDataKeys = series.GetUserDataKeys().ToList();
var take = seriesUserDataKeys.Count; var take = seriesUserDataKeys.Count;
if (seriesUserDataKeys.Count > 1) if (seriesUserDataKeys.Count > 1)
{ {

View File

@ -100,14 +100,14 @@ namespace MediaBrowser.Controller.Entities.TV
return series is null ? SeriesName : series.SortName; return series is null ? SeriesName : series.SortName;
} }
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
var series = Series; var series = Series;
if (series is not null) if (series is not null)
{ {
var newList = series.GetUserDataKeys(); var newList = series.GetUserDataKeys().ToList();
var suffix = (IndexNumber ?? 0).ToString("000", CultureInfo.InvariantCulture); var suffix = (IndexNumber ?? 0).ToString("000", CultureInfo.InvariantCulture);
for (int i = 0; i < newList.Count; i++) for (int i = 0; i < newList.Count; i++)
{ {
@ -158,7 +158,7 @@ namespace MediaBrowser.Controller.Entities.TV
try try
{ {
query.Parent = this; query.Parent = this;
query.ChannelIds = new[] { ChannelId }; query.ChannelIds = [ChannelId];
return ChannelManager.GetChannelItemsInternal(query, new Progress<double>(), CancellationToken.None).GetAwaiter().GetResult(); return ChannelManager.GetChannelItemsInternal(query, new Progress<double>(), CancellationToken.None).GetAwaiter().GetResult();
} }
catch catch
@ -189,27 +189,27 @@ namespace MediaBrowser.Controller.Entities.TV
/// <param name="options">The options to use.</param> /// <param name="options">The options to use.</param>
/// <param name="shouldIncludeMissingEpisodes">If missing episodes should be included.</param> /// <param name="shouldIncludeMissingEpisodes">If missing episodes should be included.</param>
/// <returns>Set of episodes.</returns> /// <returns>Set of episodes.</returns>
public List<BaseItem> GetEpisodes(User user, DtoOptions options, bool shouldIncludeMissingEpisodes) public IReadOnlyList<BaseItem> GetEpisodes(User user, DtoOptions options, bool shouldIncludeMissingEpisodes)
{ {
return GetEpisodes(Series, user, options, shouldIncludeMissingEpisodes); return GetEpisodes(Series, user, options, shouldIncludeMissingEpisodes);
} }
public List<BaseItem> GetEpisodes(Series series, User user, DtoOptions options, bool shouldIncludeMissingEpisodes) public IReadOnlyList<BaseItem> GetEpisodes(Series series, User user, DtoOptions options, bool shouldIncludeMissingEpisodes)
{ {
return GetEpisodes(series, user, null, options, shouldIncludeMissingEpisodes); return GetEpisodes(series, user, null, options, shouldIncludeMissingEpisodes);
} }
public List<BaseItem> GetEpisodes(Series series, User user, IEnumerable<Episode> allSeriesEpisodes, DtoOptions options, bool shouldIncludeMissingEpisodes) public IReadOnlyList<BaseItem> GetEpisodes(Series series, User user, IEnumerable<Episode> allSeriesEpisodes, DtoOptions options, bool shouldIncludeMissingEpisodes)
{ {
return series.GetSeasonEpisodes(this, user, allSeriesEpisodes, options, shouldIncludeMissingEpisodes); return series.GetSeasonEpisodes(this, user, allSeriesEpisodes, options, shouldIncludeMissingEpisodes);
} }
public List<BaseItem> GetEpisodes() public IReadOnlyList<BaseItem> GetEpisodes()
{ {
return Series.GetSeasonEpisodes(this, null, null, new DtoOptions(true), true); return Series.GetSeasonEpisodes(this, null, null, new DtoOptions(true), true);
} }
public override List<BaseItem> GetChildren(User user, bool includeLinkedChildren, InternalItemsQuery query) public override IReadOnlyList<BaseItem> GetChildren(User user, bool includeLinkedChildren, InternalItemsQuery query)
{ {
return GetEpisodes(user, new DtoOptions(true), true); return GetEpisodes(user, new DtoOptions(true), true);
} }

View File

@ -1,5 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -28,7 +29,7 @@ namespace MediaBrowser.Controller.Entities.TV
{ {
public Series() public Series()
{ {
AirDays = Array.Empty<DayOfWeek>(); AirDays = [];
} }
public DayOfWeek[] AirDays { get; set; } public DayOfWeek[] AirDays { get; set; }
@ -168,9 +169,9 @@ namespace MediaBrowser.Controller.Entities.TV
/// Gets the user data key. /// Gets the user data key.
/// </summary> /// </summary>
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
if (this.TryGetProviderId(MetadataProvider.Imdb, out var key)) 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); await ProviderManager.RefreshSingleItem(this, refreshOptions, cancellationToken).ConfigureAwait(false);
} }
public List<BaseItem> GetSeasonEpisodes(Season parentSeason, User user, DtoOptions options, bool shouldIncludeMissingEpisodes) public IReadOnlyList<BaseItem> GetSeasonEpisodes(Season parentSeason, User user, DtoOptions options, bool shouldIncludeMissingEpisodes)
{ {
var queryFromSeries = ConfigurationManager.Configuration.DisplaySpecialsWithinSeasons; var queryFromSeries = ConfigurationManager.Configuration.DisplaySpecialsWithinSeasons;
@ -406,7 +407,7 @@ namespace MediaBrowser.Controller.Entities.TV
return GetSeasonEpisodes(parentSeason, user, allItems, options, shouldIncludeMissingEpisodes); return GetSeasonEpisodes(parentSeason, user, allItems, options, shouldIncludeMissingEpisodes);
} }
public List<BaseItem> GetSeasonEpisodes(Season parentSeason, User user, IEnumerable<BaseItem> allSeriesEpisodes, DtoOptions options, bool shouldIncludeMissingEpisodes) public IReadOnlyList<BaseItem> GetSeasonEpisodes(Season parentSeason, User user, IEnumerable<BaseItem> allSeriesEpisodes, DtoOptions options, bool shouldIncludeMissingEpisodes)
{ {
if (allSeriesEpisodes is null) if (allSeriesEpisodes is null)
{ {

View File

@ -990,7 +990,7 @@ namespace MediaBrowser.Controller.Entities
return _userViewManager.GetUserSubView(parent.Id, type, localizationKey, sortName); return _userViewManager.GetUserSubView(parent.Id, type, localizationKey, sortName);
} }
public static IEnumerable<BaseItem> FilterForAdjacency(List<BaseItem> list, Guid adjacentTo) public static IEnumerable<BaseItem> FilterForAdjacency(IReadOnlyList<BaseItem> list, Guid adjacentTo)
{ {
var adjacentToItem = list.FirstOrDefault(i => i.Id.Equals(adjacentTo)); var adjacentToItem = list.FirstOrDefault(i => i.Id.Equals(adjacentTo));

View File

@ -1,5 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -259,9 +260,9 @@ namespace MediaBrowser.Controller.Entities
[JsonIgnore] [JsonIgnore]
public override MediaType MediaType => MediaType.Video; public override MediaType MediaType => MediaType.Video;
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
if (EnableDefaultVideoUserDataKeys) if (EnableDefaultVideoUserDataKeys)
{ {

View File

@ -5,6 +5,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Linq;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -35,9 +36,9 @@ namespace MediaBrowser.Controller.Entities
return false; return false;
} }
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
list.Insert(0, "Year-" + Name); list.Insert(0, "Year-" + Name);
return list; return list;

View File

@ -1,10 +1,10 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using Jellyfin.Data.Enums; using Jellyfin.Data.Enums;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Configuration;

View File

@ -1,5 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.LiveTv;

View File

@ -170,6 +170,6 @@ namespace MediaBrowser.Controller.LiveTv
public interface ISupportsDirectStreamProvider public interface ISupportsDirectStreamProvider
{ {
Task<ILiveStream> GetChannelStreamWithDirectStreamProvider(string channelId, string streamId, List<ILiveStream> currentLiveStreams, CancellationToken cancellationToken); Task<ILiveStream> GetChannelStreamWithDirectStreamProvider(string channelId, string streamId, IReadOnlyList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken);
} }
} }

View File

@ -43,7 +43,7 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="currentLiveStreams">The current live streams.</param> /// <param name="currentLiveStreams">The current live streams.</param>
/// <param name="cancellationToken">The cancellation token to cancel operation.</param> /// <param name="cancellationToken">The cancellation token to cancel operation.</param>
/// <returns>Live stream wrapped in a task.</returns> /// <returns>Live stream wrapped in a task.</returns>
Task<ILiveStream> GetChannelStream(string channelId, string streamId, IList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken); Task<ILiveStream> GetChannelStream(string channelId, string streamId, IReadOnlyList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Gets the channel stream media sources. /// Gets the channel stream media sources.

View File

@ -88,9 +88,9 @@ namespace MediaBrowser.Controller.LiveTv
[JsonIgnore] [JsonIgnore]
public string EpisodeTitle { get; set; } public string EpisodeTitle { get; set; }
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
if (!ConfigurationManager.Configuration.DisableLiveTvChannelUserDataName) if (!ConfigurationManager.Configuration.DisableLiveTvChannelUserDataName)
{ {

View File

@ -162,9 +162,9 @@ namespace MediaBrowser.Controller.LiveTv
[JsonIgnore] [JsonIgnore]
public override bool SupportsAncestors => false; public override bool SupportsAncestors => false;
public override List<string> GetUserDataKeys() public override IReadOnlyList<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys().ToList();
if (!IsSeries) if (!IsSeries)
{ {

View File

@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.LiveTv
{ {
public ProgramInfo() public ProgramInfo()
{ {
Genres = new List<string>(); Genres = [];
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
SeriesProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); SeriesProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
@ -65,7 +65,7 @@ namespace MediaBrowser.Controller.LiveTv
/// <summary> /// <summary>
/// Gets or sets the genre of the program. /// Gets or sets the genre of the program.
/// </summary> /// </summary>
public List<string> Genres { get; set; } public IReadOnlyList<string> Genres { get; set; }
/// <summary> /// <summary>
/// Gets or sets the original air date. /// Gets or sets the original air date.

View File

@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.LiveTv
{ {
public SeriesTimerInfo() public SeriesTimerInfo()
{ {
Days = new List<DayOfWeek>(); Days = [];
SkipEpisodesInLibrary = true; SkipEpisodesInLibrary = true;
KeepUntil = KeepUntil.UntilDeleted; KeepUntil = KeepUntil.UntilDeleted;
} }
@ -86,7 +86,7 @@ namespace MediaBrowser.Controller.LiveTv
/// Gets or sets the days. /// Gets or sets the days.
/// </summary> /// </summary>
/// <value>The days.</value> /// <value>The days.</value>
public List<DayOfWeek> Days { get; set; } public IReadOnlyList<DayOfWeek> Days { get; set; }
/// <summary> /// <summary>
/// Gets or sets the priority. /// Gets or sets the priority.

View File

@ -1,5 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -14,11 +15,11 @@ namespace MediaBrowser.Controller.LiveTv
{ {
public TimerInfo() public TimerInfo()
{ {
Genres = Array.Empty<string>(); Genres = [];
KeepUntil = KeepUntil.UntilDeleted; KeepUntil = KeepUntil.UntilDeleted;
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
SeriesProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); SeriesProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
Tags = Array.Empty<string>(); Tags = [];
} }
public Dictionary<string, string> ProviderIds { get; set; } public Dictionary<string, string> ProviderIds { get; set; }

View File

@ -1,10 +1,10 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591, SA1401 #pragma warning disable CS1591, SA1401
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using Jellyfin.Data.Enums; using Jellyfin.Data.Enums;
@ -31,9 +31,9 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
TranscodingType = jobType; TranscodingType = jobType;
RemoteHttpHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); RemoteHttpHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
SupportedAudioCodecs = Array.Empty<string>(); SupportedAudioCodecs = [];
SupportedVideoCodecs = Array.Empty<string>(); SupportedVideoCodecs = [];
SupportedSubtitleCodecs = Array.Empty<string>(); SupportedSubtitleCodecs = [];
} }
public TranscodeReason TranscodeReasons public TranscodeReason TranscodeReasons
@ -599,7 +599,7 @@ namespace MediaBrowser.Controller.MediaEncoding
} }
} }
return Array.Empty<string>(); return [];
} }
public string[] GetRequestedRangeTypes(string codec) public string[] GetRequestedRangeTypes(string codec)
@ -619,7 +619,7 @@ namespace MediaBrowser.Controller.MediaEncoding
} }
} }
return Array.Empty<string>(); return [];
} }
public string[] GetRequestedCodecTags(string codec) public string[] GetRequestedCodecTags(string codec)
@ -639,7 +639,7 @@ namespace MediaBrowser.Controller.MediaEncoding
} }
} }
return Array.Empty<string>(); return [];
} }
public string GetRequestedLevel(string codec) public string GetRequestedLevel(string codec)

View File

@ -118,7 +118,7 @@ namespace MediaBrowser.Controller.Playlists
return 1; return 1;
} }
public override bool IsAuthorizedToDelete(User user, List<Folder> allCollectionFolders) public override bool IsAuthorizedToDelete(User user, IReadOnlyList<Folder> allCollectionFolders)
{ {
return true; return true;
} }

View File

@ -1,3 +1,4 @@
#pragma warning disable CA1002 // Do not expose generic lists
#pragma warning disable CS1591 #pragma warning disable CS1591
using System.Collections.Generic; using System.Collections.Generic;
@ -32,7 +33,7 @@ namespace MediaBrowser.Controller.Resolvers
{ {
MultiItemResolverResult ResolveMultiple( MultiItemResolverResult ResolveMultiple(
Folder parent, Folder parent,
List<FileSystemMetadata> files, IReadOnlyList<FileSystemMetadata> files,
CollectionType? collectionType, CollectionType? collectionType,
IDirectoryService directoryService); IDirectoryService directoryService);
} }
@ -41,8 +42,8 @@ namespace MediaBrowser.Controller.Resolvers
{ {
public MultiItemResolverResult() public MultiItemResolverResult()
{ {
Items = new List<BaseItem>(); Items = [];
ExtraFiles = new List<FileSystemMetadata>(); ExtraFiles = [];
} }
public List<BaseItem> Items { get; set; } public List<BaseItem> Items { get; set; }

View File

@ -204,7 +204,7 @@ namespace MediaBrowser.Controller.Session
/// <param name="data">The data.</param> /// <param name="data">The data.</param>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns> /// <returns>Task.</returns>
Task SendMessageToUserSessions<T>(List<Guid> userIds, SessionMessageType name, T data, CancellationToken cancellationToken); Task SendMessageToUserSessions<T>(IEnumerable<Guid> userIds, SessionMessageType name, T data, CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Sends the message to user sessions. /// Sends the message to user sessions.
@ -215,7 +215,7 @@ namespace MediaBrowser.Controller.Session
/// <param name="dataFn">Data function.</param> /// <param name="dataFn">Data function.</param>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns> /// <returns>Task.</returns>
Task SendMessageToUserSessions<T>(List<Guid> userIds, SessionMessageType name, Func<T> dataFn, CancellationToken cancellationToken); Task SendMessageToUserSessions<T>(IEnumerable<Guid> userIds, SessionMessageType name, Func<T> dataFn, CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Sends the message to user device sessions. /// Sends the message to user device sessions.

View File

@ -1,5 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;

View File

@ -45,7 +45,7 @@ namespace MediaBrowser.Controller.SyncPlay
/// <param name="session">The session.</param> /// <param name="session">The session.</param>
/// <param name="request">The request.</param> /// <param name="request">The request.</param>
/// <returns>The list of available groups.</returns> /// <returns>The list of available groups.</returns>
List<GroupInfoDto> ListGroups(SessionInfo session, ListGroupsRequest request); IReadOnlyList<GroupInfoDto> ListGroups(SessionInfo session, ListGroupsRequest request);
/// <summary> /// <summary>
/// Gets available groups for a session by id. /// Gets available groups for a session by id.

View File

@ -15,7 +15,6 @@ using Jellyfin.Database.Implementations.Enums;
using Jellyfin.Extensions; using Jellyfin.Extensions;
using MediaBrowser.Common; using MediaBrowser.Common;
using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.MediaEncoding;

View File

@ -1,89 +1,96 @@
#pragma warning disable CS1591 #pragma warning disable CA1819 // Properties should not return arrays
using System; using System;
namespace MediaBrowser.Model.Channels namespace MediaBrowser.Model.Channels;
/// <summary>
/// Channel Features.
/// </summary>
public class ChannelFeatures
{ {
public class ChannelFeatures /// <summary>
/// Initializes a new instance of the <see cref="ChannelFeatures"/> class.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="id">The id.</param>
public ChannelFeatures(string name, Guid id)
{ {
public ChannelFeatures(string name, Guid id) MediaTypes = [];
{ ContentTypes = [];
MediaTypes = Array.Empty<ChannelMediaType>(); DefaultSortFields = [];
ContentTypes = Array.Empty<ChannelMediaContentType>();
DefaultSortFields = Array.Empty<ChannelItemSortField>();
Name = name; Name = name;
Id = id; Id = id;
}
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public Guid Id { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance can search.
/// </summary>
/// <value><c>true</c> if this instance can search; otherwise, <c>false</c>.</value>
public bool CanSearch { get; set; }
/// <summary>
/// Gets or sets the media types.
/// </summary>
/// <value>The media types.</value>
public ChannelMediaType[] MediaTypes { get; set; }
/// <summary>
/// Gets or sets the content types.
/// </summary>
/// <value>The content types.</value>
public ChannelMediaContentType[] ContentTypes { get; set; }
/// <summary>
/// Gets or sets the maximum number of records the channel allows retrieving at a time.
/// </summary>
public int? MaxPageSize { get; set; }
/// <summary>
/// Gets or sets the automatic refresh levels.
/// </summary>
/// <value>The automatic refresh levels.</value>
public int? AutoRefreshLevels { get; set; }
/// <summary>
/// Gets or sets the default sort orders.
/// </summary>
/// <value>The default sort orders.</value>
public ChannelItemSortField[] DefaultSortFields { get; set; }
/// <summary>
/// Gets or sets a value indicating whether a sort ascending/descending toggle is supported.
/// </summary>
public bool SupportsSortOrderToggle { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [supports latest media].
/// </summary>
/// <value><c>true</c> if [supports latest media]; otherwise, <c>false</c>.</value>
public bool SupportsLatestMedia { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance can filter.
/// </summary>
/// <value><c>true</c> if this instance can filter; otherwise, <c>false</c>.</value>
public bool CanFilter { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [supports content downloading].
/// </summary>
/// <value><c>true</c> if [supports content downloading]; otherwise, <c>false</c>.</value>
public bool SupportsContentDownloading { get; set; }
} }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public Guid Id { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance can search.
/// </summary>
/// <value><c>true</c> if this instance can search; otherwise, <c>false</c>.</value>
public bool CanSearch { get; set; }
/// <summary>
/// Gets or sets the media types.
/// </summary>
/// <value>The media types.</value>
public ChannelMediaType[] MediaTypes { get; set; }
/// <summary>
/// Gets or sets the content types.
/// </summary>
/// <value>The content types.</value>
public ChannelMediaContentType[] ContentTypes { get; set; }
/// <summary>
/// Gets or sets the maximum number of records the channel allows retrieving at a time.
/// </summary>
public int? MaxPageSize { get; set; }
/// <summary>
/// Gets or sets the automatic refresh levels.
/// </summary>
/// <value>The automatic refresh levels.</value>
public int? AutoRefreshLevels { get; set; }
/// <summary>
/// Gets or sets the default sort orders.
/// </summary>
/// <value>The default sort orders.</value>
public ChannelItemSortField[] DefaultSortFields { get; set; }
/// <summary>
/// Gets or sets a value indicating whether a sort ascending/descending toggle is supported.
/// </summary>
public bool SupportsSortOrderToggle { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [supports latest media].
/// </summary>
/// <value><c>true</c> if [supports latest media]; otherwise, <c>false</c>.</value>
public bool SupportsLatestMedia { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance can filter.
/// </summary>
/// <value><c>true</c> if this instance can filter; otherwise, <c>false</c>.</value>
public bool CanFilter { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [supports content downloading].
/// </summary>
/// <value><c>true</c> if [supports content downloading]; otherwise, <c>false</c>.</value>
public bool SupportsContentDownloading { get; set; }
} }

View File

@ -1,59 +1,86 @@
#pragma warning disable CS1591 #pragma warning disable CA1819 // Properties should not return arrays
using System; using System;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying; using MediaBrowser.Model.Querying;
namespace MediaBrowser.Model.Channels namespace MediaBrowser.Model.Channels;
/// <summary>
/// Gets or sets the fields to return within the items, in addition to basic information.
/// </summary>
/// <value>The fields.</value>
public class ChannelQuery
{ {
public class ChannelQuery /// <summary>
{ /// Gets or sets the fields to return within the items, in addition to basic information.
/// <summary> /// </summary>
/// Gets or sets the fields to return within the items, in addition to basic information. /// <value>The fields.</value>
/// </summary> public ItemFields[]? Fields { get; set; }
/// <value>The fields.</value>
public ItemFields[]? Fields { get; set; }
public bool? EnableImages { get; set; } /// <summary>
/// Gets or sets a value indicating whether [enable images].
/// </summary>
/// <value><c>true</c> if [enable images]; otherwise, <c>false</c>.</value>
public bool? EnableImages { get; set; }
public int? ImageTypeLimit { get; set; } /// <summary>
/// Gets or sets the image type limit.
/// </summary>
/// <value>The image type limit.</value>
public int? ImageTypeLimit { get; set; }
public ImageType[]? EnableImageTypes { get; set; } /// <summary>
/// Gets or sets the enabled image types.
/// </summary>
/// <value>The enabled image types.</value>
public ImageType[]? EnableImageTypes { get; set; }
/// <summary> /// <summary>
/// Gets or sets the user identifier. /// Gets or sets the user identifier.
/// </summary> /// </summary>
/// <value>The user identifier.</value> /// <value>The user identifier.</value>
public Guid UserId { get; set; } public Guid UserId { get; set; }
/// <summary> /// <summary>
/// Gets or sets the start index. Use for paging. /// Gets or sets the start index. Use for paging.
/// </summary> /// </summary>
/// <value>The start index.</value> /// <value>The start index.</value>
public int? StartIndex { get; set; } public int? StartIndex { get; set; }
/// <summary> /// <summary>
/// Gets or sets the maximum number of items to return. /// Gets or sets the maximum number of items to return.
/// </summary> /// </summary>
/// <value>The limit.</value> /// <value>The limit.</value>
public int? Limit { get; set; } public int? Limit { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether [supports latest items]. /// Gets or sets a value indicating whether [supports latest items].
/// </summary> /// </summary>
/// <value><c>true</c> if [supports latest items]; otherwise, <c>false</c>.</value> /// <value><c>true</c> if [supports latest items]; otherwise, <c>false</c>.</value>
public bool? SupportsLatestItems { get; set; } public bool? SupportsLatestItems { get; set; }
public bool? SupportsMediaDeletion { get; set; } /// <summary>
/// Gets or sets a value indicating whether [supports media deletion].
/// </summary>
/// <value><c>true</c> if [supports media deletion]; otherwise, <c>false</c>.</value>
public bool? SupportsMediaDeletion { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this instance is favorite. /// Gets or sets a value indicating whether this instance is favorite.
/// </summary> /// </summary>
/// <value><c>null</c> if [is favorite] contains no value, <c>true</c> if [is favorite]; otherwise, <c>false</c>.</value> /// <value><c>null</c> if [is favorite] contains no value, <c>true</c> if [is favorite]; otherwise, <c>false</c>.</value>
public bool? IsFavorite { get; set; } public bool? IsFavorite { get; set; }
public bool? IsRecordingsFolder { get; set; } /// <summary>
/// Gets or sets a value indicating whether this instance is a recording folder.
/// </summary>
/// <value><c>true</c> if [is recording folder]; otherwise, <c>false</c>.</value>
public bool? IsRecordingsFolder { get; set; }
public bool RefreshLatestChannelItems { get; set; } /// <summary>
} /// Gets or sets a value indicating whether latest channel items should be refreshed.
/// </summary>
/// <value><c>true</c> if [refresh latest channel items]; otherwise, <c>false</c>.</value>
public bool RefreshLatestChannelItems { get; set; }
} }

View File

@ -1,8 +1,8 @@
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Linq;
namespace MediaBrowser.Model.Configuration namespace MediaBrowser.Model.Configuration
{ {
@ -12,14 +12,14 @@ namespace MediaBrowser.Model.Configuration
public LibraryOptions() public LibraryOptions()
{ {
TypeOptions = Array.Empty<TypeOptions>(); TypeOptions = [];
DisabledSubtitleFetchers = Array.Empty<string>(); DisabledSubtitleFetchers = [];
DisabledMediaSegmentProviders = Array.Empty<string>(); DisabledMediaSegmentProviders = [];
MediaSegmentProviderOrder = Array.Empty<string>(); MediaSegmentProviderOrder = [];
SubtitleFetcherOrder = Array.Empty<string>(); SubtitleFetcherOrder = [];
DisabledLocalMetadataReaders = Array.Empty<string>(); DisabledLocalMetadataReaders = [];
DisabledLyricFetchers = Array.Empty<string>(); DisabledLyricFetchers = [];
LyricFetcherOrder = Array.Empty<string>(); LyricFetcherOrder = [];
SkipSubtitlesIfAudioTrackMatches = true; SkipSubtitlesIfAudioTrackMatches = true;
RequirePerfectSubtitleMatch = true; RequirePerfectSubtitleMatch = true;
@ -30,14 +30,14 @@ namespace MediaBrowser.Model.Configuration
SaveSubtitlesWithMedia = true; SaveSubtitlesWithMedia = true;
SaveLyricsWithMedia = false; SaveLyricsWithMedia = false;
SaveTrickplayWithMedia = false; SaveTrickplayWithMedia = false;
PathInfos = Array.Empty<MediaPathInfo>(); PathInfos = [];
EnableAutomaticSeriesGrouping = true; EnableAutomaticSeriesGrouping = true;
SeasonZeroDisplayName = "Specials"; SeasonZeroDisplayName = "Specials";
PreferNonstandardArtistsTag = false; PreferNonstandardArtistsTag = false;
UseCustomTagDelimiters = false; UseCustomTagDelimiters = false;
CustomTagDelimiters = _defaultTagDelimiters; CustomTagDelimiters = _defaultTagDelimiters;
DelimiterWhitelist = Array.Empty<string>(); DelimiterWhitelist = [];
} }
public bool Enabled { get; set; } = true; public bool Enabled { get; set; } = true;

View File

@ -1,7 +1,8 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Configuration namespace MediaBrowser.Model.Configuration
@ -10,8 +11,8 @@ namespace MediaBrowser.Model.Configuration
{ {
public MetadataPluginSummary() public MetadataPluginSummary()
{ {
SupportedImageTypes = Array.Empty<ImageType>(); SupportedImageTypes = [];
Plugins = Array.Empty<MetadataPlugin>(); Plugins = [];
} }
/// <summary> /// <summary>

View File

@ -1,4 +1,5 @@
using System.Collections.Generic; #pragma warning disable CA1819 // Properties should not return arrays
using System.Diagnostics; using System.Diagnostics;
namespace MediaBrowser.Model.Configuration; namespace MediaBrowser.Model.Configuration;
@ -11,18 +12,18 @@ public class TrickplayOptions
/// <summary> /// <summary>
/// Gets or sets a value indicating whether or not to use HW acceleration. /// Gets or sets a value indicating whether or not to use HW acceleration.
/// </summary> /// </summary>
public bool EnableHwAcceleration { get; set; } = false; public bool EnableHwAcceleration { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether or not to use HW accelerated MJPEG encoding. /// Gets or sets a value indicating whether or not to use HW accelerated MJPEG encoding.
/// </summary> /// </summary>
public bool EnableHwEncoding { get; set; } = false; public bool EnableHwEncoding { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether to only extract key frames. /// 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. /// Significantly faster, but is not compatible with all decoders and/or video files.
/// </summary> /// </summary>
public bool EnableKeyFrameOnlyExtraction { get; set; } = false; public bool EnableKeyFrameOnlyExtraction { get; set; }
/// <summary> /// <summary>
/// Gets or sets the behavior used by trickplay provider on library scan/update. /// Gets or sets the behavior used by trickplay provider on library scan/update.
@ -42,7 +43,7 @@ public class TrickplayOptions
/// <summary> /// <summary>
/// Gets or sets the target width resolutions, in px, to generates preview images for. /// Gets or sets the target width resolutions, in px, to generates preview images for.
/// </summary> /// </summary>
public int[] WidthResolutions { get; set; } = new[] { 320 }; public int[] WidthResolutions { get; set; } = [320];
/// <summary> /// <summary>
/// Gets or sets number of tile images to allow in X dimension. /// Gets or sets number of tile images to allow in X dimension.

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -9,9 +11,9 @@ namespace MediaBrowser.Model.Configuration
{ {
public class TypeOptions public class TypeOptions
{ {
public static readonly ImageOption DefaultInstance = new ImageOption(); public static readonly ImageOption DefaultInstance = new();
public static readonly Dictionary<string, ImageOption[]> DefaultImageOptions = new Dictionary<string, ImageOption[]> public static readonly Dictionary<string, ImageOption[]> DefaultImageOptions = new()
{ {
{ {
"Movie", new[] "Movie", new[]
@ -304,11 +306,11 @@ namespace MediaBrowser.Model.Configuration
public TypeOptions() public TypeOptions()
{ {
MetadataFetchers = Array.Empty<string>(); MetadataFetchers = [];
MetadataFetcherOrder = Array.Empty<string>(); MetadataFetcherOrder = [];
ImageFetchers = Array.Empty<string>(); ImageFetchers = [];
ImageFetcherOrder = Array.Empty<string>(); ImageFetcherOrder = [];
ImageOptions = Array.Empty<ImageOption>(); ImageOptions = [];
} }
public string Type { get; set; } public string Type { get; set; }

View File

@ -1,3 +1,4 @@
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -22,10 +23,10 @@ namespace MediaBrowser.Model.Configuration
HidePlayedInLatest = true; HidePlayedInLatest = true;
PlayDefaultAudioTrack = true; PlayDefaultAudioTrack = true;
LatestItemsExcludes = Array.Empty<Guid>(); LatestItemsExcludes = [];
OrderedViews = Array.Empty<Guid>(); OrderedViews = [];
MyMediaExcludes = Array.Empty<Guid>(); MyMediaExcludes = [];
GroupedFolders = Array.Empty<Guid>(); GroupedFolders = [];
} }
/// <summary> /// <summary>

View File

@ -1,3 +1,5 @@
#pragma warning disable CA1819 // Properties should not return arrays
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -324,7 +324,7 @@ namespace MediaBrowser.Model.Dlna
return !condition.IsRequired; return !condition.IsRequired;
} }
var expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true); var expected = Enum.Parse<TransportStreamTimestamp>(condition.Value, true);
switch (condition.Condition) switch (condition.Condition)
{ {

View File

@ -1,3 +1,5 @@
#pragma warning disable CA1819 // Properties should not return arrays
using System; using System;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
@ -62,7 +64,7 @@ namespace MediaBrowser.Model.Dlna
/// <summary> /// <summary>
/// Gets or sets the media sources. /// Gets or sets the media sources.
/// </summary> /// </summary>
public MediaSourceInfo[] MediaSources { get; set; } = Array.Empty<MediaSourceInfo>(); public MediaSourceInfo[] MediaSources { get; set; } = [];
/// <summary> /// <summary>
/// Gets or sets the device profile. /// Gets or sets the device profile.

View File

@ -2010,7 +2010,7 @@ namespace MediaBrowser.Model.Dlna
} }
else if (condition.Condition == ProfileConditionType.NotEquals) 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<VideoRangeType>().Except(values)));
} }
else if (condition.Condition == ProfileConditionType.EqualsAny) else if (condition.Condition == ProfileConditionType.EqualsAny)
{ {

View File

@ -1,3 +1,5 @@
#pragma warning disable CA1819 // Properties should not return arrays
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Xml.Serialization; using System.Xml.Serialization;

View File

@ -1,11 +1,12 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using Jellyfin.Data.Enums; using Jellyfin.Data.Enums;
using Jellyfin.Database.Implementations.Entities;
using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Library; using MediaBrowser.Model.Library;
@ -563,7 +564,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the chapters. /// Gets or sets the chapters.
/// </summary> /// </summary>
/// <value>The chapters.</value> /// <value>The chapters.</value>
public List<ChapterInfo> Chapters { get; set; } public ChapterInfo[] Chapters { get; set; }
/// <summary> /// <summary>
/// Gets or sets the trickplay manifest. /// Gets or sets the trickplay manifest.

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System.Collections.Generic; using System.Collections.Generic;

View File

@ -1,3 +1,4 @@
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -14,12 +15,12 @@ namespace MediaBrowser.Model.Entities
/// </summary> /// </summary>
public LibraryUpdateInfo() public LibraryUpdateInfo()
{ {
FoldersAddedTo = Array.Empty<string>(); FoldersAddedTo = [];
FoldersRemovedFrom = Array.Empty<string>(); FoldersRemovedFrom = [];
ItemsAdded = Array.Empty<string>(); ItemsAdded = [];
ItemsRemoved = Array.Empty<string>(); ItemsRemoved = [];
ItemsUpdated = Array.Empty<string>(); ItemsUpdated = [];
CollectionFolders = Array.Empty<string>(); CollectionFolders = [];
} }
/// <summary> /// <summary>

View File

@ -20,7 +20,9 @@ namespace MediaBrowser.Model.Entities
/// <summary> /// <summary>
/// Class MediaStream. /// Class MediaStream.
/// </summary> /// </summary>
#pragma warning disable CA1711 // Identifiers should not have incorrect suffix
public class MediaStream public class MediaStream
#pragma warning restore CA1711 // Identifiers should not have incorrect suffix
{ {
private static readonly string[] _specialCodes = private static readonly string[] _specialCodes =
{ {

View File

@ -1,7 +1,8 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System;
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Model.Entities namespace MediaBrowser.Model.Entities
@ -16,7 +17,7 @@ namespace MediaBrowser.Model.Entities
/// </summary> /// </summary>
public VirtualFolderInfo() public VirtualFolderInfo()
{ {
Locations = Array.Empty<string>(); Locations = [];
} }
/// <summary> /// <summary>

View File

@ -1,3 +1,4 @@
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -11,7 +12,7 @@ namespace MediaBrowser.Model.Library
public UserViewQuery() public UserViewQuery()
{ {
IncludeExternalContent = true; IncludeExternalContent = true;
PresetViews = Array.Empty<CollectionType?>(); PresetViews = [];
} }
/// <summary> /// <summary>

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -10,13 +12,13 @@ namespace MediaBrowser.Model.LiveTv
{ {
public ListingsProviderInfo() public ListingsProviderInfo()
{ {
NewsCategories = new[] { "news", "journalism", "documentary", "current affairs" }; NewsCategories = ["news", "journalism", "documentary", "current affairs"];
SportsCategories = new[] { "sports", "basketball", "baseball", "football" }; SportsCategories = ["sports", "basketball", "baseball", "football"];
KidsCategories = new[] { "kids", "family", "children", "childrens", "disney" }; KidsCategories = ["kids", "family", "children", "childrens", "disney"];
MovieCategories = new[] { "movie" }; MovieCategories = ["movie"];
EnabledTuners = Array.Empty<string>(); EnabledTuners = [];
EnableAllTuners = true; EnableAllTuners = true;
ChannelMappings = Array.Empty<NameValuePair>(); ChannelMappings = [];
} }
public string Id { get; set; } public string Id { get; set; }

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -15,7 +17,7 @@ namespace MediaBrowser.Model.LiveTv
public LiveTvChannelQuery() public LiveTvChannelQuery()
{ {
EnableUserData = true; EnableUserData = true;
SortBy = Array.Empty<ItemSortBy>(); SortBy = [];
} }
/// <summary> /// <summary>

View File

@ -1,15 +1,14 @@
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.LiveTv namespace MediaBrowser.Model.LiveTv
{ {
public class LiveTvInfo public class LiveTvInfo
{ {
public LiveTvInfo() public LiveTvInfo()
{ {
Services = Array.Empty<LiveTvServiceInfo>(); Services = [];
EnabledUsers = Array.Empty<string>(); EnabledUsers = [];
} }
/// <summary> /// <summary>

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -9,9 +11,9 @@ namespace MediaBrowser.Model.LiveTv
{ {
public LiveTvOptions() public LiveTvOptions()
{ {
TunerHosts = Array.Empty<TunerHostInfo>(); TunerHosts = [];
ListingProviders = Array.Empty<ListingsProviderInfo>(); ListingProviders = [];
MediaLocationsCreated = Array.Empty<string>(); MediaLocationsCreated = [];
RecordingPostProcessorArguments = "\"{path}\""; RecordingPostProcessorArguments = "\"{path}\"";
} }

View File

@ -1,7 +1,7 @@
#nullable disable #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 namespace MediaBrowser.Model.LiveTv
{ {
@ -12,7 +12,7 @@ namespace MediaBrowser.Model.LiveTv
{ {
public LiveTvServiceInfo() public LiveTvServiceInfo()
{ {
Tuners = Array.Empty<string>(); Tuners = [];
} }
/// <summary> /// <summary>

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -22,8 +24,8 @@ namespace MediaBrowser.Model.LiveTv
{ {
public SeriesTimerInfoDto() public SeriesTimerInfoDto()
{ {
ImageTags = new Dictionary<ImageType, string>(); ImageTags = [];
Days = Array.Empty<DayOfWeek>(); Days = [];
Type = "SeriesTimer"; Type = "SeriesTimer";
} }

View File

@ -1,5 +1,6 @@
#nullable disable #nullable disable
using System.Collections.Generic;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.MediaInfo; namespace MediaBrowser.Model.MediaInfo;
@ -13,7 +14,7 @@ public class BlurayDiscInfo
/// Gets or sets the media streams. /// Gets or sets the media streams.
/// </summary> /// </summary>
/// <value>The media streams.</value> /// <value>The media streams.</value>
public MediaStream[] MediaStreams { get; set; } public IReadOnlyList<MediaStream> MediaStreams { get; set; }
/// <summary> /// <summary>
/// Gets or sets the run time ticks. /// Gets or sets the run time ticks.
@ -25,7 +26,7 @@ public class BlurayDiscInfo
/// Gets or sets the files. /// Gets or sets the files.
/// </summary> /// </summary>
/// <value>The files.</value> /// <value>The files.</value>
public string[] Files { get; set; } public IReadOnlyList<string> Files { get; set; }
/// <summary> /// <summary>
/// Gets or sets the playlist name. /// Gets or sets the playlist name.
@ -37,5 +38,5 @@ public class BlurayDiscInfo
/// Gets or sets the chapters. /// Gets or sets the chapters.
/// </summary> /// </summary>
/// <value>The chapters.</value> /// <value>The chapters.</value>
public double[] Chapters { get; set; } public IReadOnlyList<double> Chapters { get; set; }
} }

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -12,12 +14,12 @@ namespace MediaBrowser.Model.MediaInfo
{ {
public MediaInfo() public MediaInfo()
{ {
Chapters = Array.Empty<ChapterInfo>(); Chapters = [];
Artists = Array.Empty<string>(); Artists = [];
AlbumArtists = Array.Empty<string>(); AlbumArtists = [];
Studios = Array.Empty<string>(); Studios = [];
Genres = Array.Empty<string>(); Genres = [];
People = Array.Empty<BaseItemPerson>(); People = [];
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
} }

View File

@ -1,3 +1,5 @@
#pragma warning disable CA1819 // Properties should not return arrays
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Providers namespace MediaBrowser.Model.Providers

View File

@ -1,4 +1,7 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
namespace MediaBrowser.Model.Providers namespace MediaBrowser.Model.Providers
{ {
/// <summary> /// <summary>

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -12,7 +14,7 @@ namespace MediaBrowser.Model.Providers
public RemoteSearchResult() public RemoteSearchResult()
{ {
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
Artists = Array.Empty<RemoteSearchResult>(); Artists = [];
} }
/// <summary> /// <summary>

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -9,7 +11,7 @@ namespace MediaBrowser.Model.Providers
{ {
public SubtitleOptions() public SubtitleOptions()
{ {
DownloadLanguages = Array.Empty<string>(); DownloadLanguages = [];
SkipIfAudioTrackMatches = true; SkipIfAudioTrackMatches = true;
RequirePerfectMatch = true; RequirePerfectMatch = true;

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -12,7 +14,7 @@ namespace MediaBrowser.Model.Querying
{ {
public LatestItemsQuery() public LatestItemsQuery()
{ {
EnableImageTypes = Array.Empty<ImageType>(); EnableImageTypes = [];
} }
/// <summary> /// <summary>

View File

@ -1,3 +1,4 @@
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -10,7 +11,7 @@ public class NextUpQuery
{ {
public NextUpQuery() public NextUpQuery()
{ {
EnableImageTypes = Array.Empty<ImageType>(); EnableImageTypes = [];
EnableTotalRecordCount = true; EnableTotalRecordCount = true;
NextUpDateCutoff = DateTime.MinValue; NextUpDateCutoff = DateTime.MinValue;
EnableResumable = false; EnableResumable = false;

View File

@ -1,7 +1,8 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
namespace MediaBrowser.Model.Querying namespace MediaBrowser.Model.Querying
@ -10,8 +11,8 @@ namespace MediaBrowser.Model.Querying
{ {
public QueryFilters() public QueryFilters()
{ {
Tags = Array.Empty<string>(); Tags = [];
Genres = Array.Empty<NameGuidPair>(); Genres = [];
} }
public NameGuidPair[] Genres { get; set; } public NameGuidPair[] Genres { get; set; }

View File

@ -1,7 +1,7 @@
#nullable disable #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 namespace MediaBrowser.Model.Querying
{ {
@ -9,10 +9,10 @@ namespace MediaBrowser.Model.Querying
{ {
public QueryFiltersLegacy() public QueryFiltersLegacy()
{ {
Genres = Array.Empty<string>(); Genres = [];
Tags = Array.Empty<string>(); Tags = [];
OfficialRatings = Array.Empty<string>(); OfficialRatings = [];
Years = Array.Empty<int>(); Years = [];
} }
public string[] Genres { get; set; } public string[] Genres { get; set; }

View File

@ -1,3 +1,4 @@
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
@ -15,9 +16,9 @@ namespace MediaBrowser.Model.Search
IncludePeople = true; IncludePeople = true;
IncludeStudios = true; IncludeStudios = true;
MediaTypes = Array.Empty<MediaType>(); MediaTypes = [];
IncludeItemTypes = Array.Empty<BaseItemKind>(); IncludeItemTypes = [];
ExcludeItemTypes = Array.Empty<BaseItemKind>(); ExcludeItemTypes = [];
} }
/// <summary> /// <summary>

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;

View File

@ -1,23 +1,24 @@
#pragma warning disable CA1819 // Properties should not return arrays
using System; using System;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
namespace MediaBrowser.Model.Session namespace MediaBrowser.Model.Session;
/// <summary>
/// Class UserDataChangeInfo.
/// </summary>
public class UserDataChangeInfo
{ {
/// <summary> /// <summary>
/// Class UserDataChangeInfo. /// Gets or sets the user id.
/// </summary> /// </summary>
public class UserDataChangeInfo /// <value>The user id.</value>
{ public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the user id.
/// </summary>
/// <value>The user id.</value>
public Guid UserId { get; set; }
/// <summary> /// <summary>
/// Gets or sets the user data list. /// Gets or sets the user data list.
/// </summary> /// </summary>
/// <value>The user data list.</value> /// <value>The user data list.</value>
public required UserItemDataDto[] UserDataList { get; set; } public required UserItemDataDto[] UserDataList { get; set; }
}
} }

View File

@ -1,4 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;

View File

@ -1,7 +1,6 @@
#pragma warning disable CA1819 // Properties should not return arrays
#pragma warning disable CS1591 #pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.Users namespace MediaBrowser.Model.Users
{ {
public class PinRedeemResult public class PinRedeemResult
@ -16,6 +15,6 @@ namespace MediaBrowser.Model.Users
/// Gets or sets the users reset. /// Gets or sets the users reset.
/// </summary> /// </summary>
/// <value>The users reset.</value> /// <value>The users reset.</value>
public string[] UsersReset { get; set; } = Array.Empty<string>(); public string[] UsersReset { get; set; } = [];
} }
} }

View File

@ -127,7 +127,7 @@ namespace MediaBrowser.Providers.MediaInfo
blurayDiscInfo = GetBDInfo(item.Path); blurayDiscInfo = GetBDInfo(item.Path);
// Return if no playable .m2ts files are found // 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."); _logger.LogError("No playable .m2ts files found in Blu-ray structure, skipping FFprobe.");
return ItemUpdateType.MetadataImport; return ItemUpdateType.MetadataImport;
@ -343,9 +343,9 @@ namespace MediaBrowser.Providers.MediaInfo
if (blurayInfo.Chapters is not null) if (blurayInfo.Chapters is not null)
{ {
double[] brChapter = blurayInfo.Chapters; var brChapter = blurayInfo.Chapters;
chapters = new ChapterInfo[brChapter.Length]; chapters = new ChapterInfo[brChapter.Count];
for (int i = 0; i < brChapter.Length; i++) for (int i = 0; i < brChapter.Count; i++)
{ {
chapters[i] = new ChapterInfo chapters[i] = new ChapterInfo
{ {

View File

@ -459,7 +459,7 @@ namespace Jellyfin.LiveTv
throw new NotImplementedException(); throw new NotImplementedException();
} }
public async Task<ILiveStream> GetChannelStreamWithDirectStreamProvider(string channelId, string streamId, List<ILiveStream> currentLiveStreams, CancellationToken cancellationToken) public async Task<ILiveStream> GetChannelStreamWithDirectStreamProvider(string channelId, string streamId, IReadOnlyList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken)
{ {
_logger.LogInformation("Streaming Channel {Id}", channelId); _logger.LogInformation("Streaming Channel {Id}", channelId);

View File

@ -166,9 +166,9 @@ namespace Jellyfin.LiveTv.TunerHosts
return new List<MediaSourceInfo>(); return new List<MediaSourceInfo>();
} }
protected abstract Task<ILiveStream> GetChannelStream(TunerHostInfo tunerHost, ChannelInfo channel, string streamId, IList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken); protected abstract Task<ILiveStream> GetChannelStream(TunerHostInfo tunerHost, ChannelInfo channel, string streamId, IReadOnlyList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken);
public async Task<ILiveStream> GetChannelStream(string channelId, string streamId, IList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken) public async Task<ILiveStream> GetChannelStream(string channelId, string streamId, IReadOnlyList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken)
{ {
ArgumentException.ThrowIfNullOrEmpty(channelId); ArgumentException.ThrowIfNullOrEmpty(channelId);

View File

@ -40,7 +40,7 @@ namespace Jellyfin.LiveTv.TunerHosts.HdHomerun
private readonly JsonSerializerOptions _jsonOptions; private readonly JsonSerializerOptions _jsonOptions;
private readonly Dictionary<string, DiscoverResponse> _modelCache = new Dictionary<string, DiscoverResponse>(); private readonly Dictionary<string, DiscoverResponse> _modelCache = [];
public HdHomerunHost( public HdHomerunHost(
IServerConfigurationManager config, IServerConfigurationManager config,
@ -382,7 +382,7 @@ namespace Jellyfin.LiveTv.TunerHosts.HdHomerun
return list; return list;
} }
protected override async Task<ILiveStream> GetChannelStream(TunerHostInfo tunerHost, ChannelInfo channel, string streamId, IList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken) protected override async Task<ILiveStream> GetChannelStream(TunerHostInfo tunerHost, ChannelInfo channel, string streamId, IReadOnlyList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken)
{ {
var tunerCount = tunerHost.TunerCount; var tunerCount = tunerHost.TunerCount;

View File

@ -75,7 +75,7 @@ namespace Jellyfin.LiveTv.TunerHosts
.ConfigureAwait(false); .ConfigureAwait(false);
} }
protected override async Task<ILiveStream> GetChannelStream(TunerHostInfo tunerHost, ChannelInfo channel, string streamId, IList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken) protected override async Task<ILiveStream> GetChannelStream(TunerHostInfo tunerHost, ChannelInfo channel, string streamId, IReadOnlyList<ILiveStream> currentLiveStreams, CancellationToken cancellationToken)
{ {
var tunerCount = tunerHost.TunerCount; var tunerCount = tunerHost.TunerCount;