The Free Software Media System - Server Backend & API
Remove more warnings
Cody Robibero7bfc6b567930
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.csindex c9847aa2d8..b530c69429 100644--- a/Emby.Drawing/ImageProcessor.cs+++ b/Emby.Drawing/ImageProcessor.cs@@ -101,7 +101,7 @@ namespace Emby.Drawingpublic async Task ProcessImage(ImageProcessingOptions options, Stream toStream){var file = await ProcessImage(options).ConfigureAwait(false);- using (var fileStream = AsyncFile.OpenRead(file.path))+ using (var fileStream = AsyncFile.OpenRead(file.Path)){await fileStream.CopyToAsync(toStream).ConfigureAwait(false);}@@ -116,7 +116,7 @@ namespace Emby.Drawing=> _transparentImageTypes.Contains(Path.GetExtension(path));/// <inheritdoc />- public async Task<(string path, string? mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options)+ public async Task<(string Path, string? MimeType, DateTime DateModified)> ProcessImage(ImageProcessingOptions options){ItemImageInfo originalImage = options.Image;BaseItem item = options.Item;@@ -135,14 +135,14 @@ namespace Emby.Drawing}var supportedImageInfo = await GetSupportedImage(originalImagePath, dateModified).ConfigureAwait(false);- originalImagePath = supportedImageInfo.path;+ originalImagePath = supportedImageInfo.Path;if (!File.Exists(originalImagePath)){return (originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);}- dateModified = supportedImageInfo.dateModified;+ dateModified = supportedImageInfo.DateModified;bool requiresTransparency = _transparentImageTypes.Contains(Path.GetExtension(originalImagePath));bool autoOrient = false;@@ -436,7 +436,7 @@ namespace Emby.Drawing.ToString("N", CultureInfo.InvariantCulture);}- private async Task<(string path, DateTime dateModified)> GetSupportedImage(string originalImagePath, DateTime dateModified)+ private async Task<(string Path, DateTime DateModified)> GetSupportedImage(string originalImagePath, DateTime dateModified){var inputFormat = Path.GetExtension(originalImagePath).TrimStart('.')diff --git a/Emby.Naming/TV/SeasonPathParser.cs b/Emby.Naming/TV/SeasonPathParser.csindex 6236f86c43..fc9ee8e569 100644--- a/Emby.Naming/TV/SeasonPathParser.cs+++ b/Emby.Naming/TV/SeasonPathParser.cs@@ -55,7 +55,7 @@ namespace Emby.Naming.TV/// <param name="supportSpecialAliases">if set to <c>true</c> [support special aliases].</param>/// <param name="supportNumericSeasonFolders">if set to <c>true</c> [support numeric season folders].</param>/// <returns>System.Nullable{System.Int32}.</returns>- private static (int? seasonNumber, bool isSeasonFolder) GetSeasonNumberFromPath(+ private static (int? SeasonNumber, bool IsSeasonFolder) GetSeasonNumberFromPath(string path,bool supportSpecialAliases,bool supportNumericSeasonFolders)@@ -99,7 +99,7 @@ namespace Emby.Naming.TVif (filename.Contains(name, StringComparison.OrdinalIgnoreCase)){var result = GetSeasonNumberFromPathSubstring(filename.Replace(name, " ", StringComparison.OrdinalIgnoreCase));- if (result.seasonNumber.HasValue)+ if (result.SeasonNumber.HasValue){return result;}@@ -142,7 +142,7 @@ namespace Emby.Naming.TV/// </summary>/// <param name="path">The path.</param>/// <returns>System.Nullable{System.Int32}.</returns>- private static (int? seasonNumber, bool isSeasonFolder) GetSeasonNumberFromPathSubstring(ReadOnlySpan<char> path)+ private static (int? SeasonNumber, bool IsSeasonFolder) GetSeasonNumberFromPathSubstring(ReadOnlySpan<char> path){var numericStart = -1;var length = 0;diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.csindex 8702691d1d..43c8a451b0 100644--- a/Emby.Server.Implementations/Channels/ChannelManager.cs+++ b/Emby.Server.Implementations/Channels/ChannelManager.cs@@ -130,16 +130,14 @@ namespace Emby.Server.Implementations.Channelsvar internalChannel = _libraryManager.GetItemById(item.ChannelId);if (internalChannel == null){- throw new ArgumentException();+ throw new ArgumentException(nameof(item.ChannelId));}var channel = Channels.FirstOrDefault(i => GetInternalChannelId(i.Name).Equals(internalChannel.Id));- var supportsDelete = channel as ISupportsDelete;-- if (supportsDelete == null)+ if (channel is not ISupportsDelete supportsDelete){- throw new ArgumentException();+ throw new ArgumentException(nameof(channel));}return supportsDelete.DeleteItem(item.ExternalId, CancellationToken.None);diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.csindex 79ef70fffd..b5b8fea651 100644--- a/Emby.Server.Implementations/Collections/CollectionManager.cs+++ b/Emby.Server.Implementations/Collections/CollectionManager.cs@@ -140,7 +140,7 @@ namespace Emby.Server.Implementations.Collectionsif (parentFolder == null){- throw new ArgumentException();+ throw new ArgumentException(nameof(parentFolder));}var path = Path.Combine(parentFolder.Path, folderName);diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.csindex a6b48b2120..47d10b0acf 100644--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs@@ -248,40 +248,6 @@ namespace Emby.Server.Implementations.DataBaseItemKind.AudioBook};- private static readonly Type[] _knownTypes =- {- typeof(LiveTvProgram),- typeof(LiveTvChannel),- typeof(Series),- typeof(Audio),- typeof(MusicAlbum),- typeof(MusicArtist),- typeof(MusicGenre),- typeof(MusicVideo),- typeof(Movie),- typeof(Playlist),- typeof(AudioBook),- typeof(Trailer),- typeof(BoxSet),- typeof(Episode),- typeof(Season),- typeof(Series),- typeof(Book),- typeof(CollectionFolder),- typeof(Folder),- typeof(Genre),- typeof(Person),- typeof(Photo),- typeof(PhotoAlbum),- typeof(Studio),- typeof(UserRootFolder),- typeof(UserView),- typeof(Video),- typeof(Year),- typeof(Channel),- typeof(AggregateFolder)- };-private static readonly Dictionary<BaseItemKind, string> _baseItemKindNames = new(){{ BaseItemKind.AggregateFolder, typeof(AggregateFolder).FullName },@@ -688,13 +654,13 @@ namespace Emby.Server.Implementations.Dataconnection.RunInTransaction(db =>{- SaveItemsInTranscation(db, tuples);+ SaveItemsInTransaction(db, tuples);},TransactionMode);}}- private void SaveItemsInTranscation(IDatabaseConnection db, IEnumerable<(BaseItem, List<Guid>, BaseItem, string, List<string>)> tuples)+ private void SaveItemsInTransaction(IDatabaseConnection db, IEnumerable<(BaseItem Item, List<Guid> AncestorIds, BaseItem TopParent, string UserDataKey, List<string> InheritedTags)> tuples){var statements = PrepareAll(db, new string[]{@@ -713,17 +679,17 @@ namespace Emby.Server.Implementations.DatasaveItemStatement.Reset();}- var item = tuple.Item1;- var topParent = tuple.Item3;- var userDataKey = tuple.Item4;+ var item = tuple.Item;+ var topParent = tuple.TopParent;+ var userDataKey = tuple.UserDataKey;SaveItem(item, topParent, userDataKey, saveItemStatement);- var inheritedTags = tuple.Item5;+ var inheritedTags = tuple.InheritedTags;if (item.SupportsAncestors){- UpdateAncestors(item.Id, tuple.Item2, db, deleteAncestorsStatement);+ UpdateAncestors(item.Id, tuple.AncestorIds, db, deleteAncestorsStatement);}UpdateItemValues(item.Id, GetItemValuesToSave(item, inheritedTags), db);@@ -2201,7 +2167,7 @@ namespace Emby.Server.Implementations.Datareturn false;}- var sortingFields = new HashSet<string>(query.OrderBy.Select(i => i.Item1), StringComparer.OrdinalIgnoreCase);+ var sortingFields = new HashSet<string>(query.OrderBy.Select(i => i.OrderBy), StringComparer.OrdinalIgnoreCase);return sortingFields.Contains(ItemSortBy.IsFavoriteOrLiked)|| sortingFields.Contains(ItemSortBy.IsPlayed)@@ -3049,88 +3015,86 @@ namespace Emby.Server.Implementations.Datareturn " ORDER BY " + string.Join(',', orderBy.Select(i =>{- var columnMap = MapOrderByField(i.Item1, query);-- var sortOrder = i.Item2 == SortOrder.Ascending ? "ASC" : "DESC";+ var columnMap = MapOrderByField(i.OrderBy, query);- return columnMap.Item1 + " " + sortOrder;+ return columnMap.SortBy + " " + columnMap.SortOrder;}));}- private (string, bool) MapOrderByField(string name, InternalItemsQuery query)+ private (string SortBy, SortOrder SortOrder) MapOrderByField(string name, InternalItemsQuery query){if (string.Equals(name, ItemSortBy.AirTime, StringComparison.OrdinalIgnoreCase)){// TODO- return ("SortName", false);+ return ("SortName", SortOrder.Descending);}else if (string.Equals(name, ItemSortBy.Runtime, StringComparison.OrdinalIgnoreCase)){- return ("RuntimeTicks", false);+ return ("RuntimeTicks", SortOrder.Descending);}else if (string.Equals(name, ItemSortBy.Random, StringComparison.OrdinalIgnoreCase)){- return ("RANDOM()", false);+ return ("RANDOM()", SortOrder.Descending);}else if (string.Equals(name, ItemSortBy.DatePlayed, StringComparison.OrdinalIgnoreCase)){if (query.GroupBySeriesPresentationUniqueKey){- return ("MAX(LastPlayedDate)", false);+ return ("MAX(LastPlayedDate)", SortOrder.Descending);}- return ("LastPlayedDate", false);+ return ("LastPlayedDate", SortOrder.Descending);}else if (string.Equals(name, ItemSortBy.PlayCount, StringComparison.OrdinalIgnoreCase)){- return ("PlayCount", false);+ return ("PlayCount", SortOrder.Descending);}else if (string.Equals(name, ItemSortBy.IsFavoriteOrLiked, StringComparison.OrdinalIgnoreCase)){- return ("(Select Case When IsFavorite is null Then 0 Else IsFavorite End )", true);+ return ("(Select Case When IsFavorite is null Then 0 Else IsFavorite End )", SortOrder.Ascending);}else if (string.Equals(name, ItemSortBy.IsFolder, StringComparison.OrdinalIgnoreCase)){- return ("IsFolder", true);+ return ("IsFolder", SortOrder.Ascending);}else if (string.Equals(name, ItemSortBy.IsPlayed, StringComparison.OrdinalIgnoreCase)){- return ("played", true);+ return ("played", SortOrder.Ascending);}else if (string.Equals(name, ItemSortBy.IsUnplayed, StringComparison.OrdinalIgnoreCase)){- return ("played", false);+ return ("played", SortOrder.Descending);}else if (string.Equals(name, ItemSortBy.DateLastContentAdded, StringComparison.OrdinalIgnoreCase)){- return ("DateLastMediaAdded", false);+ return ("DateLastMediaAdded", SortOrder.Descending);}else if (string.Equals(name, ItemSortBy.Artist, StringComparison.OrdinalIgnoreCase)){- return ("(select CleanValue from itemvalues where ItemId=Guid and Type=0 LIMIT 1)", false);+ return ("(select CleanValue from itemvalues where ItemId=Guid and Type=0 LIMIT 1)", SortOrder.Descending);}else if (string.Equals(name, ItemSortBy.AlbumArtist, StringComparison.OrdinalIgnoreCase)){- return ("(select CleanValue from itemvalues where ItemId=Guid and Type=1 LIMIT 1)", false);+ return ("(select CleanValue from itemvalues where ItemId=Guid and Type=1 LIMIT 1)", SortOrder.Descending);}else if (string.Equals(name, ItemSortBy.OfficialRating, StringComparison.OrdinalIgnoreCase)){- return ("InheritedParentalRatingValue", false);+ return ("InheritedParentalRatingValue", SortOrder.Descending);}else if (string.Equals(name, ItemSortBy.Studio, StringComparison.OrdinalIgnoreCase)){- return ("(select CleanValue from itemvalues where ItemId=Guid and Type=3 LIMIT 1)", false);+ return ("(select CleanValue from itemvalues where ItemId=Guid and Type=3 LIMIT 1)", SortOrder.Descending);}else if (string.Equals(name, ItemSortBy.SeriesDatePlayed, StringComparison.OrdinalIgnoreCase)){- return ("(Select MAX(LastPlayedDate) from TypedBaseItems B" + GetJoinUserDataText(query) + " where Played=1 and B.SeriesPresentationUniqueKey=A.PresentationUniqueKey)", false);+ return ("(Select MAX(LastPlayedDate) from TypedBaseItems B" + GetJoinUserDataText(query) + " where Played=1 and B.SeriesPresentationUniqueKey=A.PresentationUniqueKey)", SortOrder.Descending);}else if (string.Equals(name, ItemSortBy.SeriesSortName, StringComparison.OrdinalIgnoreCase)){- return ("SeriesName", false);+ return ("SeriesName", SortOrder.Descending);}- return (name, false);+ return (name, SortOrder.Descending);}public List<Guid> GetItemIdsList(InternalItemsQuery query)@@ -5230,32 +5194,32 @@ AND Type = @InternalPersonType)");}}- public QueryResult<(BaseItem, ItemCounts)> GetAllArtists(InternalItemsQuery query)+ public QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAllArtists(InternalItemsQuery query){return GetItemValues(query, new[] { 0, 1 }, typeof(MusicArtist).FullName);}- public QueryResult<(BaseItem, ItemCounts)> GetArtists(InternalItemsQuery query)+ public QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetArtists(InternalItemsQuery query){return GetItemValues(query, new[] { 0 }, typeof(MusicArtist).FullName);}- public QueryResult<(BaseItem, ItemCounts)> GetAlbumArtists(InternalItemsQuery query)+ public QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAlbumArtists(InternalItemsQuery query){return GetItemValues(query, new[] { 1 }, typeof(MusicArtist).FullName);}- public QueryResult<(BaseItem, ItemCounts)> GetStudios(InternalItemsQuery query)+ public QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetStudios(InternalItemsQuery query){return GetItemValues(query, new[] { 3 }, typeof(Studio).FullName);}- public QueryResult<(BaseItem, ItemCounts)> GetGenres(InternalItemsQuery query)+ public QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetGenres(InternalItemsQuery query){return GetItemValues(query, new[] { 2 }, typeof(Genre).FullName);}- public QueryResult<(BaseItem, ItemCounts)> GetMusicGenres(InternalItemsQuery query)+ public QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetMusicGenres(InternalItemsQuery query){return GetItemValues(query, new[] { 2 }, typeof(MusicGenre).FullName);}@@ -5351,7 +5315,7 @@ AND Type = @InternalPersonType)");return list;}- private QueryResult<(BaseItem, ItemCounts)> GetItemValues(InternalItemsQuery query, int[] itemValueTypes, string returnType)+ private QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetItemValues(InternalItemsQuery query, int[] itemValueTypes, string returnType){if (query == null){@@ -5676,7 +5640,7 @@ AND Type = @InternalPersonType)");return counts;}- private List<(int, string)> GetItemValuesToSave(BaseItem item, List<string> inheritedTags)+ private List<(int MagicNumber, string Value)> GetItemValuesToSave(BaseItem item, List<string> inheritedTags){var list = new List<(int, string)>();@@ -5701,7 +5665,7 @@ AND Type = @InternalPersonType)");return list;}- private void UpdateItemValues(Guid itemId, List<(int, string)> values, IDatabaseConnection db)+ private void UpdateItemValues(Guid itemId, List<(int MagicNumber, string Value)> values, IDatabaseConnection db){if (itemId.Equals(Guid.Empty)){@@ -5723,7 +5687,7 @@ AND Type = @InternalPersonType)");InsertItemValues(guidBlob, values, db);}- private void InsertItemValues(byte[] idBlob, List<(int, string)> values, IDatabaseConnection db)+ private void InsertItemValues(byte[] idBlob, List<(int MagicNumber, string Value)> values, IDatabaseConnection db){const int Limit = 100;var startIndex = 0;@@ -5755,7 +5719,7 @@ AND Type = @InternalPersonType)");var currentValueInfo = values[i];- var itemValue = currentValueInfo.Item2;+ var itemValue = currentValueInfo.Value;// Don't save if invalidif (string.IsNullOrWhiteSpace(itemValue))@@ -5763,7 +5727,7 @@ AND Type = @InternalPersonType)");continue;}- statement.TryBind("@Type" + index, currentValueInfo.Item1);+ statement.TryBind("@Type" + index, currentValueInfo.MagicNumber);statement.TryBind("@Value" + index, itemValue);statement.TryBind("@CleanValue" + index, GetCleanValue(itemValue));}diff --git a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.csindex 4a5f723273..d43996c69b 100644--- a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs+++ b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs@@ -464,6 +464,7 @@ namespace Emby.Server.Implementations.EntryPointspublic void Dispose(){Dispose(true);+ GC.SuppressFinalize(this);}/// <summary>diff --git a/Emby.Server.Implementations/IO/StreamHelper.cs b/Emby.Server.Implementations/IO/StreamHelper.csindex e4f5f4cf0b..f55c16d6d7 100644--- a/Emby.Server.Implementations/IO/StreamHelper.cs+++ b/Emby.Server.Implementations/IO/StreamHelper.cs@@ -17,11 +17,11 @@ namespace Emby.Server.Implementations.IOtry{int read;- while ((read = await source.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false)) != 0)+ while ((read = await source.ReadAsync(buffer, cancellationToken).ConfigureAwait(false)) != 0){cancellationToken.ThrowIfCancellationRequested();- await destination.WriteAsync(buffer, 0, read, cancellationToken).ConfigureAwait(false);+ await destination.WriteAsync(buffer.AsMemory(0, read), cancellationToken).ConfigureAwait(false);if (onStarted != null){@@ -44,11 +44,11 @@ namespace Emby.Server.Implementations.IOif (emptyReadLimit <= 0){int read;- while ((read = await source.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false)) != 0)+ while ((read = await source.ReadAsync(buffer, cancellationToken).ConfigureAwait(false)) != 0){cancellationToken.ThrowIfCancellationRequested();- await destination.WriteAsync(buffer, 0, read, cancellationToken).ConfigureAwait(false);+ await destination.WriteAsync(buffer.AsMemory(0, read), cancellationToken).ConfigureAwait(false);}return;@@ -60,7 +60,7 @@ namespace Emby.Server.Implementations.IO{cancellationToken.ThrowIfCancellationRequested();- var bytesRead = await source.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false);+ var bytesRead = await source.ReadAsync(buffer, cancellationToken).ConfigureAwait(false);if (bytesRead == 0){@@ -71,7 +71,7 @@ namespace Emby.Server.Implementations.IO{eofCount = 0;- await destination.WriteAsync(buffer, 0, bytesRead, cancellationToken).ConfigureAwait(false);+ await destination.WriteAsync(buffer.AsMemory(0, bytesRead), cancellationToken).ConfigureAwait(false);}}}@@ -88,13 +88,13 @@ namespace Emby.Server.Implementations.IO{int bytesRead;- while ((bytesRead = await source.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false)) != 0)+ while ((bytesRead = await source.ReadAsync(buffer, cancellationToken).ConfigureAwait(false)) != 0){var bytesToWrite = Math.Min(bytesRead, copyLength);if (bytesToWrite > 0){- await destination.WriteAsync(buffer, 0, Convert.ToInt32(bytesToWrite), cancellationToken).ConfigureAwait(false);+ await destination.WriteAsync(buffer.AsMemory(0, Convert.ToInt32(bytesToWrite)), cancellationToken).ConfigureAwait(false);}copyLength -= bytesToWrite;@@ -137,9 +137,9 @@ namespace Emby.Server.Implementations.IOint bytesRead;int totalBytesRead = 0;- while ((bytesRead = await source.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false)) != 0)+ while ((bytesRead = await source.ReadAsync(buffer, cancellationToken).ConfigureAwait(false)) != 0){- await destination.WriteAsync(buffer, 0, bytesRead, cancellationToken).ConfigureAwait(false);+ await destination.WriteAsync(buffer.AsMemory(0, bytesRead), cancellationToken).ConfigureAwait(false);totalBytesRead += bytesRead;}diff --git a/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs b/Emby.Server.Implementations/Images/CollectionFolderImageProvider.csindex 7e12ebb087..7958eb8f58 100644--- a/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs+++ b/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs@@ -68,9 +68,9 @@ namespace Emby.Server.Implementations.ImagesDtoOptions = new DtoOptions(false),ImageTypes = new ImageType[] { ImageType.Primary },Limit = 8,- OrderBy = new ValueTuple<string, SortOrder>[]+ OrderBy = new[]{- new ValueTuple<string, SortOrder>(ItemSortBy.Random, SortOrder.Ascending)+ (ItemSortBy.Random, SortOrder.Ascending)},IncludeItemTypes = includeItemTypes});diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.csindex e30fa7097b..0fa779a0a7 100644--- a/Emby.Server.Implementations/Library/LibraryManager.cs+++ b/Emby.Server.Implementations/Library/LibraryManager.cs@@ -1373,7 +1373,7 @@ namespace Emby.Server.Implementations.Libraryreturn _itemRepository.GetItemIdsList(query);}- public QueryResult<(BaseItem, ItemCounts)> GetStudios(InternalItemsQuery query)+ public QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetStudios(InternalItemsQuery query){if (query.User != null){@@ -1384,7 +1384,7 @@ namespace Emby.Server.Implementations.Libraryreturn _itemRepository.GetStudios(query);}- public QueryResult<(BaseItem, ItemCounts)> GetGenres(InternalItemsQuery query)+ public QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetGenres(InternalItemsQuery query){if (query.User != null){@@ -1395,7 +1395,7 @@ namespace Emby.Server.Implementations.Libraryreturn _itemRepository.GetGenres(query);}- public QueryResult<(BaseItem, ItemCounts)> GetMusicGenres(InternalItemsQuery query)+ public QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetMusicGenres(InternalItemsQuery query){if (query.User != null){@@ -1406,7 +1406,7 @@ namespace Emby.Server.Implementations.Libraryreturn _itemRepository.GetMusicGenres(query);}- public QueryResult<(BaseItem, ItemCounts)> GetAllArtists(InternalItemsQuery query)+ public QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAllArtists(InternalItemsQuery query){if (query.User != null){@@ -1417,7 +1417,7 @@ namespace Emby.Server.Implementations.Libraryreturn _itemRepository.GetAllArtists(query);}- public QueryResult<(BaseItem, ItemCounts)> GetArtists(InternalItemsQuery query)+ public QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetArtists(InternalItemsQuery query){if (query.User != null){@@ -1458,7 +1458,7 @@ namespace Emby.Server.Implementations.Library}}- public QueryResult<(BaseItem, ItemCounts)> GetAlbumArtists(InternalItemsQuery query)+ public QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAlbumArtists(InternalItemsQuery query){if (query.User != null){@@ -1757,7 +1757,7 @@ namespace Emby.Server.Implementations.Libraryreturn orderedItems ?? items;}- public IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<ValueTuple<string, SortOrder>> orderBy)+ public IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<(string OrderBy, SortOrder SortOrder)> orderBy){var isFirst = true;diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.csindex 972d4ebbbf..a414e7e16b 100644--- a/Emby.Server.Implementations/Library/MediaSourceManager.cs+++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs@@ -464,12 +464,11 @@ namespace Emby.Server.Implementations.Librarytry{- var tuple = GetProvider(request.OpenToken);- var provider = tuple.Item1;+ var (provider, keyId) = GetProvider(request.OpenToken);var currentLiveStreams = _openStreams.Values.ToList();- liveStream = await provider.OpenMediaSource(tuple.Item2, currentLiveStreams, cancellationToken).ConfigureAwait(false);+ liveStream = await provider.OpenMediaSource(keyId, currentLiveStreams, cancellationToken).ConfigureAwait(false);mediaSource = liveStream.MediaSource;@@ -829,7 +828,7 @@ namespace Emby.Server.Implementations.Library}}- private (IMediaSourceProvider, string) GetProvider(string key)+ private (IMediaSourceProvider MediaSourceProvider, string KeyId) GetProvider(string key){if (string.IsNullOrEmpty(key)){diff --git a/Emby.Server.Implementations/Library/SearchEngine.cs b/Emby.Server.Implementations/Library/SearchEngine.csindex 4aacf7774c..55911933ac 100644--- a/Emby.Server.Implementations/Library/SearchEngine.cs+++ b/Emby.Server.Implementations/Library/SearchEngine.cs@@ -190,7 +190,7 @@ namespace Emby.Server.Implementations.LibrarysearchQuery.ParentId = Guid.Empty;searchQuery.IncludeItemsByName = true;searchQuery.IncludeItemTypes = Array.Empty<BaseItemKind>();- mediaItems = _libraryManager.GetAllArtists(searchQuery).Items.Select(i => i.Item1).ToList();+ mediaItems = _libraryManager.GetAllArtists(searchQuery).Items.Select(i => i.Item).ToList();}else{diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.csindex 2fbd47bc77..a8440102df 100644--- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs+++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs@@ -643,7 +643,9 @@ namespace Emby.Server.Implementations.LiveTv.ListingsCancellationToken cancellationToken){using var options = new HttpRequestMessage(HttpMethod.Post, ApiUrl + "/token");+#pragma warning disable CA5350 // SchedulesDirect is always SHA1.var hashedPasswordBytes = SHA1.HashData(Encoding.ASCII.GetBytes(password));+#pragma warning restore CA5350// TODO: remove ToLower when Convert.ToHexString supports lowercase// Schedules Direct requires the hex to be lowercasestring hashedPassword = Convert.ToHexString(hashedPasswordBytes).ToLowerInvariant();diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.csindex 047d8e98c9..aa3598c8b2 100644--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs@@ -207,7 +207,7 @@ namespace Emby.Server.Implementations.LiveTvorderBy.Insert(0, (ItemSortBy.IsFavoriteOrLiked, SortOrder.Descending));}- if (!internalQuery.OrderBy.Any(i => string.Equals(i.Item1, ItemSortBy.SortName, StringComparison.OrdinalIgnoreCase)))+ if (!internalQuery.OrderBy.Any(i => string.Equals(i.OrderBy, ItemSortBy.SortName, StringComparison.OrdinalIgnoreCase))){orderBy.Add((ItemSortBy.SortName, SortOrder.Ascending));}@@ -520,7 +520,7 @@ namespace Emby.Server.Implementations.LiveTvreturn item;}- private (LiveTvProgram item, bool isNew, bool isUpdated) GetProgram(ProgramInfo info, Dictionary<Guid, LiveTvProgram> allExistingPrograms, LiveTvChannel channel)+ private (LiveTvProgram Item, bool IsNew, bool IsUpdated) GetProgram(ProgramInfo info, Dictionary<Guid, LiveTvProgram> allExistingPrograms, LiveTvChannel channel){var id = _tvDtoService.GetInternalProgramId(info.Id);@@ -779,9 +779,9 @@ namespace Emby.Server.Implementations.LiveTvvar dto = _dtoService.GetBaseItemDto(program, new DtoOptions(), user);- var list = new List<Tuple<BaseItemDto, string, string>>+ var list = new List<(BaseItemDto ItemDto, string ExternalId, string ExternalSeriesId)>{- new Tuple<BaseItemDto, string, string>(dto, program.ExternalId, program.ExternalSeriesId)+ (dto, program.ExternalId, program.ExternalSeriesId)};await AddRecordingInfo(list, cancellationToken).ConfigureAwait(false);@@ -976,16 +976,16 @@ namespace Emby.Server.Implementations.LiveTvreturn score;}- private async Task AddRecordingInfo(IEnumerable<Tuple<BaseItemDto, string, string>> programs, CancellationToken cancellationToken)+ private async Task AddRecordingInfo(IEnumerable<(BaseItemDto ItemDto, string ExternalId, string ExternalSeriesId)> programs, CancellationToken cancellationToken){IReadOnlyList<TimerInfo> timerList = null;IReadOnlyList<SeriesTimerInfo> seriesTimerList = null;foreach (var programTuple in programs){- var program = programTuple.Item1;- var externalProgramId = programTuple.Item2;- string externalSeriesId = programTuple.Item3;+ var program = programTuple.ItemDto;+ var externalProgramId = programTuple.ExternalId;+ string externalSeriesId = programTuple.ExternalSeriesId;timerList ??= (await GetTimersInternal(new TimerQuery(), cancellationToken).ConfigureAwait(false)).Items;@@ -1186,13 +1186,13 @@ namespace Emby.Server.Implementations.LiveTvforeach (var program in channelPrograms){var programTuple = GetProgram(program, existingPrograms, currentChannel);- var programItem = programTuple.item;+ var programItem = programTuple.Item;- if (programTuple.isNew)+ if (programTuple.IsNew){newPrograms.Add(programItem);}- else if (programTuple.isUpdated)+ else if (programTuple.IsUpdated){updatedPrograms.Add(programItem);}@@ -1423,9 +1423,9 @@ namespace Emby.Server.Implementations.LiveTvreturn result;}- public Task AddInfoToProgramDto(IReadOnlyCollection<(BaseItem, BaseItemDto)> programs, IReadOnlyList<ItemFields> fields, User user = null)+ public Task AddInfoToProgramDto(IReadOnlyCollection<(BaseItem Item, BaseItemDto ItemDto)> programs, IReadOnlyList<ItemFields> fields, User user = null){- var programTuples = new List<Tuple<BaseItemDto, string, string>>();+ var programTuples = new List<(BaseItemDto Dto, string ExternalId, string ExternalSeriesId)>();var hasChannelImage = fields.Contains(ItemFields.ChannelImage);var hasChannelInfo = fields.Contains(ItemFields.ChannelInfo);@@ -1461,7 +1461,7 @@ namespace Emby.Server.Implementations.LiveTv}}- programTuples.Add(new Tuple<BaseItemDto, string, string>(dto, program.ExternalId, program.ExternalSeriesId));+ programTuples.Add((dto, program.ExternalId, program.ExternalSeriesId));}return AddRecordingInfo(programTuples, CancellationToken.None);@@ -1868,11 +1868,11 @@ namespace Emby.Server.Implementations.LiveTvreturn _libraryManager.GetItemById(internalChannelId);}- public void AddChannelInfo(IReadOnlyCollection<(BaseItemDto, LiveTvChannel)> items, DtoOptions options, User user)+ public void AddChannelInfo(IReadOnlyCollection<(BaseItemDto ItemDto, LiveTvChannel Channel)> items, DtoOptions options, User user){var now = DateTime.UtcNow;- var channelIds = items.Select(i => i.Item2.Id).Distinct().ToArray();+ var channelIds = items.Select(i => i.Channel.Id).Distinct().ToArray();var programs = options.AddCurrentProgram ? _libraryManager.GetItemList(new InternalItemsQuery(user){@@ -1893,11 +1893,8 @@ namespace Emby.Server.Implementations.LiveTvvar addCurrentProgram = options.AddCurrentProgram;- foreach (var tuple in items)+ foreach (var (dto, channel) in items){- var dto = tuple.Item1;- var channel = tuple.Item2;-dto.Number = channel.Number;dto.ChannelNumber = channel.Number;dto.ChannelType = channel.ChannelType;diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunChannelCommands.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunChannelCommands.csindex 069b4fab6b..aae33503fa 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunChannelCommands.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunChannelCommands.cs@@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun_profile = profile;}- public IEnumerable<(string, string)> GetCommands()+ public IEnumerable<(string CommandName, string CommandValue)> GetCommands(){if (!string.IsNullOrEmpty(_channel)){diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.csindex f009c77cf3..f1a6ef3443 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs@@ -114,7 +114,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerunforeach (var command in commands.GetCommands()){- var channelMsgLen = WriteSetMessage(buffer, i, command.Item1, command.Item2, lockKeyValue);+ var channelMsgLen = WriteSetMessage(buffer, i, command.CommandName, command.CommandValue, lockKeyValue);await stream.WriteAsync(buffer.AsMemory(0, channelMsgLen), cancellationToken).ConfigureAwait(false);receivedBytes = await stream.ReadAsync(buffer, cancellationToken).ConfigureAwait(false);@@ -167,7 +167,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun{foreach (var command in commandList){- var channelMsgLen = WriteSetMessage(buffer, _activeTuner, command.Item1, command.Item2, _lockkey);+ var channelMsgLen = WriteSetMessage(buffer, _activeTuner, command.CommandName, command.CommandValue, _lockkey);await stream.WriteAsync(buffer.AsMemory(0, channelMsgLen), cancellationToken).ConfigureAwait(false);int receivedBytes = await stream.ReadAsync(buffer, cancellationToken).ConfigureAwait(false);diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.csindex d2f0334394..9ed0d8d73d 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs@@ -212,7 +212,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerunif (read > 0){- fileStream.Write(buffer, RtpHeaderBytes, read);+ await fileStream.WriteAsync(buffer.AsMemory(RtpHeaderBytes, read), linkedSource.Token).ConfigureAwait(false);}if (!resolved)diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/IHdHomerunChannelCommands.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/IHdHomerunChannelCommands.csindex 1533549320..11bd40ab10 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/IHdHomerunChannelCommands.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/IHdHomerunChannelCommands.cs@@ -6,6 +6,6 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun{public interface IHdHomerunChannelCommands{- IEnumerable<(string, string)> GetCommands();+ IEnumerable<(string CommandName, string CommandValue)> GetCommands();}}diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/LegacyHdHomerunChannelCommands.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/LegacyHdHomerunChannelCommands.csindex 26627b8aa6..80d9d07247 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/LegacyHdHomerunChannelCommands.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/LegacyHdHomerunChannelCommands.cs@@ -22,7 +22,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun}}- public IEnumerable<(string, string)> GetCommands()+ public IEnumerable<(string CommandName, string CommandValue)> GetCommands(){if (!string.IsNullOrEmpty(_channel)){diff --git a/Emby.Server.Implementations/Playlists/PlaylistManager.cs b/Emby.Server.Implementations/Playlists/PlaylistManager.csindex 9481e26f72..02df2fffe6 100644--- a/Emby.Server.Implementations/Playlists/PlaylistManager.cs+++ b/Emby.Server.Implementations/Playlists/PlaylistManager.cs@@ -72,7 +72,7 @@ namespace Emby.Server.Implementations.Playlistsvar parentFolder = GetPlaylistsFolder(Guid.Empty);if (parentFolder == null){- throw new ArgumentException();+ throw new ArgumentException(nameof(parentFolder));}if (string.IsNullOrEmpty(options.MediaType))diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.csindex 5dbe9f44d7..c994ffc904 100644--- a/Emby.Server.Implementations/TV/TVSeriesManager.cs+++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs@@ -117,7 +117,7 @@ namespace Emby.Server.Implementations.TVnew InternalItemsQuery(user){IncludeItemTypes = new[] { BaseItemKind.Episode },- OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.DatePlayed, SortOrder.Descending) },+ OrderBy = new[] { (ItemSortBy.DatePlayed, SortOrder.Descending) },SeriesPresentationUniqueKey = presentationUniqueKey,Limit = limit,DtoOptions = new DtoOptions { Fields = new[] { ItemFields.SeriesPresentationUniqueKey }, EnableImages = false },@@ -193,7 +193,7 @@ namespace Emby.Server.Implementations.TVAncestorWithPresentationUniqueKey = null,SeriesPresentationUniqueKey = seriesKey,IncludeItemTypes = new[] { BaseItemKind.Episode },- OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.SortName, SortOrder.Descending) },+ OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Descending) },IsPlayed = true,Limit = 1,ParentIndexNumberNotEquals = 0,@@ -211,7 +211,7 @@ namespace Emby.Server.Implementations.TVAncestorWithPresentationUniqueKey = null,SeriesPresentationUniqueKey = seriesKey,IncludeItemTypes = new[] { BaseItemKind.Episode },- OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.SortName, SortOrder.Ascending) },+ OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },Limit = 1,IsPlayed = false,IsVirtualItem = false,diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.csindex 24d592525d..5eb4c9ffa9 100644--- a/Emby.Server.Implementations/Updates/InstallationManager.cs+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs@@ -52,7 +52,7 @@ namespace Emby.Server.Implementations.Updates/// <summary>/// The current installations./// </summary>- private readonly List<(InstallationInfo info, CancellationTokenSource token)> _currentInstallations;+ private readonly List<(InstallationInfo Info, CancellationTokenSource Token)> _currentInstallations;/// <summary>/// The completed installations.@@ -399,13 +399,13 @@ namespace Emby.Server.Implementations.Updates{lock (_currentInstallationsLock){- var install = _currentInstallations.Find(x => x.info.Id == id);+ var install = _currentInstallations.Find(x => x.Info.Id == id);if (install == default((InstallationInfo, CancellationTokenSource))){return false;}- install.token.Cancel();+ install.Token.Cancel();_currentInstallations.Remove(install);return true;}diff --git a/Jellyfin.Api/Controllers/FilterController.cs b/Jellyfin.Api/Controllers/FilterController.csindex e170436d16..a4f12666d3 100644--- a/Jellyfin.Api/Controllers/FilterController.cs+++ b/Jellyfin.Api/Controllers/FilterController.cs@@ -197,16 +197,16 @@ namespace Jellyfin.Api.Controllers{filters.Genres = _libraryManager.GetMusicGenres(genreQuery).Items.Select(i => new NameGuidPair{- Name = i.Item1.Name,- Id = i.Item1.Id+ Name = i.Item.Name,+ Id = i.Item.Id}).ToArray();}else{filters.Genres = _libraryManager.GetGenres(genreQuery).Items.Select(i => new NameGuidPair{- Name = i.Item1.Name,- Id = i.Item1.Id+ Name = i.Item.Name,+ Id = i.Item.Id}).ToArray();}diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.csindex 65c0662d21..1b938f4d58 100644--- a/Jellyfin.Api/Controllers/ItemsController.cs+++ b/Jellyfin.Api/Controllers/ItemsController.cs@@ -484,7 +484,7 @@ namespace Jellyfin.Api.Controllers// Albums by artistif (query.ArtistIds.Length > 0 && query.IncludeItemTypes.Length == 1 && query.IncludeItemTypes[0] == BaseItemKind.MusicAlbum){- query.OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.ProductionYear, SortOrder.Descending), new ValueTuple<string, SortOrder>(ItemSortBy.SortName, SortOrder.Ascending) };+ query.OrderBy = new[] { (ItemSortBy.ProductionYear, SortOrder.Descending), (ItemSortBy.SortName, SortOrder.Ascending) };}}diff --git a/Jellyfin.Api/Helpers/RequestHelpers.cs b/Jellyfin.Api/Helpers/RequestHelpers.csindex ca8bc0bdd3..1471f5a241 100644--- a/Jellyfin.Api/Helpers/RequestHelpers.cs+++ b/Jellyfin.Api/Helpers/RequestHelpers.cs@@ -30,7 +30,7 @@ namespace Jellyfin.Api.Helpers{if (sortBy.Count == 0){- return Array.Empty<ValueTuple<string, SortOrder>>();+ return Array.Empty<(string, SortOrder)>();}var result = new (string, SortOrder)[sortBy.Count];diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.csindex 3d0a51ff67..c41b343c70 100644--- a/Jellyfin.Server.Implementations/Users/UserManager.cs+++ b/Jellyfin.Server.Implementations/Users/UserManager.cs@@ -394,12 +394,12 @@ namespace Jellyfin.Server.Implementations.Usersvar user = Users.FirstOrDefault(i => string.Equals(username, i.Username, StringComparison.OrdinalIgnoreCase));var authResult = await AuthenticateLocalUser(username, password, user, remoteEndPoint).ConfigureAwait(false);- var authenticationProvider = authResult.authenticationProvider;- var success = authResult.success;+ var authenticationProvider = authResult.AuthenticationProvider;+ var success = authResult.Success;if (user == null){- string updatedUsername = authResult.username;+ string updatedUsername = authResult.Username;if (success&& authenticationProvider != null@@ -785,7 +785,7 @@ namespace Jellyfin.Server.Implementations.Usersreturn providers;}- private async Task<(IAuthenticationProvider? authenticationProvider, string username, bool success)> AuthenticateLocalUser(+ private async Task<(IAuthenticationProvider? AuthenticationProvider, string Username, bool Success)> AuthenticateLocalUser(string username,string password,User? user,@@ -798,8 +798,8 @@ namespace Jellyfin.Server.Implementations.Users{var providerAuthResult =await AuthenticateWithProvider(provider, username, password, user).ConfigureAwait(false);- var updatedUsername = providerAuthResult.username;- success = providerAuthResult.success;+ var updatedUsername = providerAuthResult.Username;+ success = providerAuthResult.Success;if (success){@@ -822,7 +822,7 @@ namespace Jellyfin.Server.Implementations.Usersreturn (authenticationProvider, username, success);}- private async Task<(string username, bool success)> AuthenticateWithProvider(+ private async Task<(string Username, bool Success)> AuthenticateWithProvider(IAuthenticationProvider provider,string username,string password,diff --git a/Jellyfin.Server/Migrations/PreStartupRoutines/CreateNetworkConfiguration.cs b/Jellyfin.Server/Migrations/PreStartupRoutines/CreateNetworkConfiguration.csindex a951f751e3..5e601ca847 100644--- a/Jellyfin.Server/Migrations/PreStartupRoutines/CreateNetworkConfiguration.cs+++ b/Jellyfin.Server/Migrations/PreStartupRoutines/CreateNetworkConfiguration.cs@@ -53,7 +53,7 @@ public class CreateNetworkConfiguration : IMigrationRoutinenetworkConfigSerializer.Serialize(xmlWriter, networkSettings);}-#pragma warning disable CS1591+#pragma warning disablepublic sealed class OldNetworkConfiguration{public const int DefaultHttpPort = 8096;@@ -134,5 +134,5 @@ public class CreateNetworkConfiguration : IMigrationRoutinepublic string[] KnownProxies { get; set; } = Array.Empty<string>();}-#pragma warning restore CS1591+#pragma warning restore}diff --git a/MediaBrowser.Common/Net/IPNetAddress.cs b/MediaBrowser.Common/Net/IPNetAddress.csindex f6e3971bf3..f1428d4bef 100644--- a/MediaBrowser.Common/Net/IPNetAddress.cs+++ b/MediaBrowser.Common/Net/IPNetAddress.cs@@ -195,7 +195,7 @@ namespace MediaBrowser.Common.Netreturn NetworkAddress.PrefixLength <= netaddrObj.PrefixLength;}- var altAddress = NetworkAddressOf(netaddrObj.Address, PrefixLength).address;+ var altAddress = NetworkAddressOf(netaddrObj.Address, PrefixLength).Address;return NetworkAddress.Address.Equals(altAddress);}diff --git a/MediaBrowser.Common/Net/IPObject.cs b/MediaBrowser.Common/Net/IPObject.csindex 2612268fd8..bd5368882e 100644--- a/MediaBrowser.Common/Net/IPObject.cs+++ b/MediaBrowser.Common/Net/IPObject.cs@@ -53,7 +53,7 @@ namespace MediaBrowser.Common.Net/// <param name="address">IP Address to convert.</param>/// <param name="prefixLength">Subnet prefix.</param>/// <returns>IPAddress.</returns>- public static (IPAddress address, byte prefixLength) NetworkAddressOf(IPAddress address, byte prefixLength)+ public static (IPAddress Address, byte PrefixLength) NetworkAddressOf(IPAddress address, byte prefixLength){if (address == null){diff --git a/MediaBrowser.Controller/Drawing/IImageProcessor.cs b/MediaBrowser.Controller/Drawing/IImageProcessor.csindex 7ca0e851bd..03882a0b97 100644--- a/MediaBrowser.Controller/Drawing/IImageProcessor.cs+++ b/MediaBrowser.Controller/Drawing/IImageProcessor.cs@@ -75,7 +75,7 @@ namespace MediaBrowser.Controller.Drawing/// </summary>/// <param name="options">The options.</param>/// <returns>Task.</returns>- Task<(string path, string? mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options);+ Task<(string Path, string? MimeType, DateTime DateModified)> ProcessImage(ImageProcessingOptions options);/// <summary>/// Gets the supported image output formats.diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.csindex 9d0187c8c2..29f7bf92b7 100644--- a/MediaBrowser.Controller/Entities/Audio/Audio.cs+++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs@@ -135,7 +135,7 @@ namespace MediaBrowser.Controller.Entities.Audioreturn info;}- protected override IEnumerable<(BaseItem, MediaSourceType)> GetAllItemsForMediaSources()+ protected override IEnumerable<(BaseItem Item, MediaSourceType MediaSourceType)> GetAllItemsForMediaSources()=> new[] { ((BaseItem)this, MediaSourceType.Default) };}}diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.csindex f5dd825489..915971adc9 100644--- a/MediaBrowser.Controller/Entities/BaseItem.cs+++ b/MediaBrowser.Controller/Entities/BaseItem.cs@@ -1069,7 +1069,7 @@ namespace MediaBrowser.Controller.Entities}var list = GetAllItemsForMediaSources();- var result = list.Select(i => GetVersionInfo(enablePathSubstitution, i.Item1, i.Item2)).ToList();+ var result = list.Select(i => GetVersionInfo(enablePathSubstitution, i.Item, i.MediaSourceType)).ToList();if (IsActiveRecording()){@@ -1097,7 +1097,7 @@ namespace MediaBrowser.Controller.Entities.ToList();}- protected virtual IEnumerable<(BaseItem, MediaSourceType)> GetAllItemsForMediaSources()+ protected virtual IEnumerable<(BaseItem Item, MediaSourceType MediaSourceType)> GetAllItemsForMediaSources(){return Enumerable.Empty<(BaseItem, MediaSourceType)>();}diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.csindex f06b5c7875..db1697c790 100644--- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs+++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs@@ -38,7 +38,7 @@ namespace MediaBrowser.Controller.EntitiesMediaTypes = Array.Empty<string>();MinSimilarityScore = 20;OfficialRatings = Array.Empty<string>();- OrderBy = Array.Empty<ValueTuple<string, SortOrder>>();+ OrderBy = Array.Empty<(string, SortOrder)>();PersonIds = Array.Empty<Guid>();PersonTypes = Array.Empty<string>();PresetViews = Array.Empty<string>();@@ -271,7 +271,7 @@ namespace MediaBrowser.Controller.Entitiespublic bool? HasChapterImages { get; set; }- public IReadOnlyList<(string, SortOrder)> OrderBy { get; set; }+ public IReadOnlyList<(string OrderBy, SortOrder SortOrder)> OrderBy { get; set; }public DateTime? MinDateCreated { get; set; }diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.csindex 4f7614f962..3e125602aa 100644--- a/MediaBrowser.Controller/Entities/Video.cs+++ b/MediaBrowser.Controller/Entities/Video.cs@@ -517,7 +517,7 @@ namespace MediaBrowser.Controller.Entities}).FirstOrDefault();}- protected override IEnumerable<(BaseItem, MediaSourceType)> GetAllItemsForMediaSources()+ protected override IEnumerable<(BaseItem Item, MediaSourceType MediaSourceType)> GetAllItemsForMediaSources(){var list = new List<(BaseItem, MediaSourceType)>{diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.csindex eba92695eb..8db5283302 100644--- a/MediaBrowser.Controller/Library/ILibraryManager.cs+++ b/MediaBrowser.Controller/Library/ILibraryManager.cs@@ -212,7 +212,7 @@ namespace MediaBrowser.Controller.Library/// <returns>IEnumerable{BaseItem}.</returns>IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<string> sortBy, SortOrder sortOrder);- IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<ValueTuple<string, SortOrder>> orderBy);+ IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<(string OrderBy, SortOrder SortOrder)> orderBy);/// <summary>/// Gets the user root folder.@@ -573,17 +573,17 @@ namespace MediaBrowser.Controller.Libraryvoid RemoveMediaPath(string virtualFolderName, string mediaPath);- QueryResult<(BaseItem, ItemCounts)> GetGenres(InternalItemsQuery query);+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetGenres(InternalItemsQuery query);- QueryResult<(BaseItem, ItemCounts)> GetMusicGenres(InternalItemsQuery query);+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetMusicGenres(InternalItemsQuery query);- QueryResult<(BaseItem, ItemCounts)> GetStudios(InternalItemsQuery query);+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetStudios(InternalItemsQuery query);- QueryResult<(BaseItem, ItemCounts)> GetArtists(InternalItemsQuery query);+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetArtists(InternalItemsQuery query);- QueryResult<(BaseItem, ItemCounts)> GetAlbumArtists(InternalItemsQuery query);+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAlbumArtists(InternalItemsQuery query);- QueryResult<(BaseItem, ItemCounts)> GetAllArtists(InternalItemsQuery query);+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAllArtists(InternalItemsQuery query);int GetCount(InternalItemsQuery query);diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.csindex dbd18165db..6dc5665b24 100644--- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs+++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs@@ -251,7 +251,7 @@ namespace MediaBrowser.Controller.LiveTv/// <param name="fields">The fields.</param>/// <param name="user">The user.</param>/// <returns>Task.</returns>- Task AddInfoToProgramDto(IReadOnlyCollection<(BaseItem, BaseItemDto)> programs, IReadOnlyList<ItemFields> fields, User user = null);+ Task AddInfoToProgramDto(IReadOnlyCollection<(BaseItem Item, BaseItemDto ItemDto)> programs, IReadOnlyList<ItemFields> fields, User user = null);/// <summary>/// Saves the tuner host.@@ -292,7 +292,7 @@ namespace MediaBrowser.Controller.LiveTv/// <param name="items">The items.</param>/// <param name="options">The options.</param>/// <param name="user">The user.</param>- void AddChannelInfo(IReadOnlyCollection<(BaseItemDto, LiveTvChannel)> items, DtoOptions options, User user);+ void AddChannelInfo(IReadOnlyCollection<(BaseItemDto ItemDto, LiveTvChannel Channel)> items, DtoOptions options, User user);Task<List<ChannelInfo>> GetChannelsForListingsProvider(string id, CancellationToken cancellationToken);diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.csindex 8c5474539e..d6f69a1509 100644--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs@@ -21,6 +21,13 @@ namespace MediaBrowser.Controller.MediaEncoding{public class EncodingHelper{+ private const string QsvAlias = "qs";+ private const string VaapiAlias = "va";+ private const string D3d11vaAlias = "dx11";+ private const string VideotoolboxAlias = "vt";+ private const string OpenclAlias = "ocl";+ private const string CudaAlias = "cu";+private readonly IMediaEncoder _mediaEncoder;private readonly ISubtitleEncoder _subtitleEncoder;@@ -42,13 +49,6 @@ namespace MediaBrowser.Controller.MediaEncoding"Main10"};- private const string QsvAlias = "qs";- private const string VaapiAlias = "va";- private const string D3d11vaAlias = "dx11";- private const string VideotoolboxAlias = "vt";- private const string OpenclAlias = "ocl";- private const string CudaAlias = "cu";-public EncodingHelper(IMediaEncoder mediaEncoder,ISubtitleEncoder subtitleEncoder)@@ -2290,7 +2290,7 @@ namespace MediaBrowser.Controller.MediaEncodingreturn returnFirstIfNoIndex ? streams.FirstOrDefault() : null;}- public static (int? width, int? height) GetFixedOutputSize(+ public static (int? Width, int? Height) GetFixedOutputSize(int? videoWidth,int? videoHeight,int? requestedWidth,@@ -2671,7 +2671,7 @@ namespace MediaBrowser.Controller.MediaEncoding/// <param name="options">Encoding options.</param>/// <param name="vidEncoder">Video encoder to use.</param>/// <returns>The tuple contains three lists: main, sub and overlay filters.</returns>- public (List<string>, List<string>, List<string>) GetSwVidFilterChain(+ public (List<string> MainFilters, List<string> SubFilters, List<string> OverlayFilters) GetSwVidFilterChain(EncodingJobInfo state,EncodingOptions options,string vidEncoder)@@ -2751,7 +2751,7 @@ namespace MediaBrowser.Controller.MediaEncoding/// <param name="options">Encoding options.</param>/// <param name="vidEncoder">Video encoder to use.</param>/// <returns>The tuple contains three lists: main, sub and overlay filters.</returns>- public (List<string>, List<string>, List<string>) GetNvidiaVidFilterChain(+ public (List<string> MainFilters, List<string> SubFilters, List<string> OverlayFilters) GetNvidiaVidFilterChain(EncodingJobInfo state,EncodingOptions options,string vidEncoder)@@ -2778,7 +2778,7 @@ namespace MediaBrowser.Controller.MediaEncodingreturn GetNvidiaVidFiltersPrefered(state, options, vidDecoder, vidEncoder);}- public (List<string>, List<string>, List<string>) GetNvidiaVidFiltersPrefered(+ public (List<string> MainFilters, List<string> SubFilters, List<string> OverlayFilters) GetNvidiaVidFiltersPrefered(EncodingJobInfo state,EncodingOptions options,string vidDecoder,@@ -2838,6 +2838,7 @@ namespace MediaBrowser.Controller.MediaEncodingmainFilters.Add("hwupload");}}+if (isNvdecDecoder){// INPUT cuda surface(vram)@@ -2938,7 +2939,7 @@ namespace MediaBrowser.Controller.MediaEncoding/// <param name="options">Encoding options.</param>/// <param name="vidEncoder">Video encoder to use.</param>/// <returns>The tuple contains three lists: main, sub and overlay filters.</returns>- public (List<string>, List<string>, List<string>) GetAmdVidFilterChain(+ public (List<string> MainFilters, List<string> SubFilters, List<string> OverlayFilters) GetAmdVidFilterChain(EncodingJobInfo state,EncodingOptions options,string vidEncoder)@@ -2966,7 +2967,7 @@ namespace MediaBrowser.Controller.MediaEncodingreturn GetAmdDx11VidFiltersPrefered(state, options, vidDecoder, vidEncoder);}- public (List<string>, List<string>, List<string>) GetAmdDx11VidFiltersPrefered(+ public (List<string> MainFilters, List<string> SubFilters, List<string> OverlayFilters) GetAmdDx11VidFiltersPrefered(EncodingJobInfo state,EncodingOptions options,string vidDecoder,@@ -3136,7 +3137,7 @@ namespace MediaBrowser.Controller.MediaEncoding/// <param name="options">Encoding options.</param>/// <param name="vidEncoder">Video encoder to use.</param>/// <returns>The tuple contains three lists: main, sub and overlay filters.</returns>- public (List<string>, List<string>, List<string>) GetIntelVidFilterChain(+ public (List<string> MainFilters, List<string> SubFilters, List<string> OverlayFilters) GetIntelVidFilterChain(EncodingJobInfo state,EncodingOptions options,string vidEncoder)@@ -3182,7 +3183,7 @@ namespace MediaBrowser.Controller.MediaEncodingreturn (null, null, null);}- public (List<string>, List<string>, List<string>) GetIntelQsvDx11VidFiltersPrefered(+ public (List<string> MainFilters, List<string> SubFilters, List<string> OverlayFilters) GetIntelQsvDx11VidFiltersPrefered(EncodingJobInfo state,EncodingOptions options,string vidDecoder,@@ -3374,7 +3375,7 @@ namespace MediaBrowser.Controller.MediaEncodingreturn (mainFilters, subFilters, overlayFilters);}- public (List<string>, List<string>, List<string>) GetIntelQsvVaapiVidFiltersPrefered(+ public (List<string> MainFilters, List<string> SubFilters, List<string> OverlayFilters) GetIntelQsvVaapiVidFiltersPrefered(EncodingJobInfo state,EncodingOptions options,string vidDecoder,@@ -3589,7 +3590,7 @@ namespace MediaBrowser.Controller.MediaEncoding/// <param name="options">Encoding options.</param>/// <param name="vidEncoder">Video encoder to use.</param>/// <returns>The tuple contains three lists: main, sub and overlay filters.</returns>- public (List<string>, List<string>, List<string>) GetVaapiVidFilterChain(+ public (List<string> MainFilters, List<string> SubFilters, List<string> OverlayFilters) GetVaapiVidFilterChain(EncodingJobInfo state,EncodingOptions options,string vidEncoder)@@ -3615,13 +3616,13 @@ namespace MediaBrowser.Controller.MediaEncodingif (!isSwEncoder){var newfilters = new List<string>();- var noOverlay = swFilterChain.Item3.Count == 0;- newfilters.AddRange(noOverlay ? swFilterChain.Item1 : swFilterChain.Item3);+ var noOverlay = swFilterChain.OverlayFilters.Count == 0;+ newfilters.AddRange(noOverlay ? swFilterChain.MainFilters : swFilterChain.OverlayFilters);newfilters.Add("hwupload");- var mainFilters = noOverlay ? newfilters : swFilterChain.Item1;- var overlayFilters = noOverlay ? swFilterChain.Item3 : newfilters;- return (mainFilters, swFilterChain.Item2, overlayFilters);+ var mainFilters = noOverlay ? newfilters : swFilterChain.MainFilters;+ var overlayFilters = noOverlay ? swFilterChain.OverlayFilters : newfilters;+ return (mainFilters, swFilterChain.SubFilters, overlayFilters);}return swFilterChain;@@ -3638,7 +3639,7 @@ namespace MediaBrowser.Controller.MediaEncodingreturn GetVaapiLimitedVidFiltersPrefered(state, options, vidDecoder, vidEncoder);}- public (List<string>, List<string>, List<string>) GetVaapiFullVidFiltersPrefered(+ public (List<string> MainFilters, List<string> SubFilters, List<string> OverlayFilters) GetVaapiFullVidFiltersPrefered(EncodingJobInfo state,EncodingOptions options,string vidDecoder,@@ -3834,7 +3835,7 @@ namespace MediaBrowser.Controller.MediaEncodingreturn (mainFilters, subFilters, overlayFilters);}- public (List<string>, List<string>, List<string>) GetVaapiLimitedVidFiltersPrefered(+ public (List<string> MainFilters, List<string> SubFilters, List<string> OverlayFilters) GetVaapiLimitedVidFiltersPrefered(EncodingJobInfo state,EncodingOptions options,string vidDecoder,@@ -4090,7 +4091,6 @@ namespace MediaBrowser.Controller.MediaEncoding"{0}",string.Join(',', overlayFilters));-var mapPrefix = Convert.ToInt32(state.SubtitleStream.IsExternal);var subtitleStreamIndex = state.SubtitleStream.IsExternal? 0diff --git a/MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.cs b/MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.csindex c38e7ec3b3..4e7e266245 100644--- a/MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.cs+++ b/MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.cs@@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.MediaEncoding{public interface IAttachmentExtractor{- Task<(MediaAttachment attachment, Stream stream)> GetAttachment(+ Task<(MediaAttachment Attachment, Stream Stream)> GetAttachment(BaseItem item,string mediaSourceId,int attachmentStreamIndex,diff --git a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.csindex 27d618a3f7..fd3eb81056 100644--- a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs+++ b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs@@ -32,19 +32,19 @@ namespace MediaBrowser.Controller.MediaEncodingVersion EncoderVersion { get; }/// <summary>- /// Whether the configured Vaapi device is from AMD(radeonsi/r600 Mesa driver).+ /// Gets a value indicating whether the configured Vaapi device is from AMD(radeonsi/r600 Mesa driver)./// </summary>/// <value><c>true</c> if the Vaapi device is an AMD(radeonsi/r600 Mesa driver) GPU, <c>false</c> otherwise.</value>bool IsVaapiDeviceAmd { get; }/// <summary>- /// Whether the configured Vaapi device is from Intel(iHD driver).+ /// Gets a value indicating whether the configured Vaapi device is from Intel(iHD driver)./// </summary>/// <value><c>true</c> if the Vaapi device is an Intel(iHD driver) GPU, <c>false</c> otherwise.</value>bool IsVaapiDeviceInteliHD { get; }/// <summary>- /// Whether the configured Vaapi device is from Intel(legacy i965 driver).+ /// Gets a value indicating whether the configured Vaapi device is from Intel(legacy i965 driver)./// </summary>/// <value><c>true</c> if the Vaapi device is an Intel(legacy i965 driver) GPU, <c>false</c> otherwise.</value>bool IsVaapiDeviceInteli965 { get; }diff --git a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs b/MediaBrowser.Controller/MediaEncoding/JobLogger.csindex 933f440ac6..8b2837ee3c 100644--- a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs+++ b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs@@ -41,7 +41,7 @@ namespace MediaBrowser.Controller.MediaEncodingbreak;}- await target.WriteAsync(bytes, 0, bytes.Length).ConfigureAwait(false);+ await target.WriteAsync(bytes).ConfigureAwait(false);// Check again, the stream could have been closedif (!target.CanWrite)diff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.csindex a084f91969..837bf0bb20 100644--- a/MediaBrowser.Controller/Persistence/IItemRepository.cs+++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs@@ -161,17 +161,17 @@ namespace MediaBrowser.Controller.Persistenceint GetCount(InternalItemsQuery query);- QueryResult<(BaseItem, ItemCounts)> GetGenres(InternalItemsQuery query);+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetGenres(InternalItemsQuery query);- QueryResult<(BaseItem, ItemCounts)> GetMusicGenres(InternalItemsQuery query);+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetMusicGenres(InternalItemsQuery query);- QueryResult<(BaseItem, ItemCounts)> GetStudios(InternalItemsQuery query);+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetStudios(InternalItemsQuery query);- QueryResult<(BaseItem, ItemCounts)> GetArtists(InternalItemsQuery query);+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetArtists(InternalItemsQuery query);- QueryResult<(BaseItem, ItemCounts)> GetAlbumArtists(InternalItemsQuery query);+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAlbumArtists(InternalItemsQuery query);- QueryResult<(BaseItem, ItemCounts)> GetAllArtists(InternalItemsQuery query);+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAllArtists(InternalItemsQuery query);List<string> GetMusicGenreNames();diff --git a/MediaBrowser.Controller/Providers/MetadataResult.cs b/MediaBrowser.Controller/Providers/MetadataResult.csindex 2085ae4adf..58a0fa2a9a 100644--- a/MediaBrowser.Controller/Providers/MetadataResult.cs+++ b/MediaBrowser.Controller/Providers/MetadataResult.cs@@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Providers{// Images aren't always used so the allocation is a waste a lot of the timeprivate List<LocalImageInfo> _images;- private List<(string url, ImageType type)> _remoteImages;+ private List<(string Url, ImageType Type)> _remoteImages;public MetadataResult(){@@ -27,9 +27,9 @@ namespace MediaBrowser.Controller.Providersset => _images = value;}- public List<(string url, ImageType type)> RemoteImages+ public List<(string Url, ImageType Type)> RemoteImages{- get => _remoteImages ??= new List<(string url, ImageType type)>();+ get => _remoteImages ??= new List<(string Url, ImageType Type)>();set => _remoteImages = value;}diff --git a/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs b/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.csindex 9ebc0d0cff..3fd4cd731b 100644--- a/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs+++ b/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs@@ -50,7 +50,7 @@ namespace MediaBrowser.MediaEncoding.Attachments}/// <inheritdoc />- public async Task<(MediaAttachment attachment, Stream stream)> GetAttachment(BaseItem item, string mediaSourceId, int attachmentStreamIndex, CancellationToken cancellationToken)+ public async Task<(MediaAttachment Attachment, Stream Stream)> GetAttachment(BaseItem item, string mediaSourceId, int attachmentStreamIndex, CancellationToken cancellationToken){if (item == null){diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.csindex fce71bf1a0..e1643ea434 100644--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs@@ -91,9 +91,13 @@ namespace MediaBrowser.MediaEncoding.Encoder/// <inheritdoc />public string EncoderPath => _ffmpegPath;+public Version EncoderVersion => _ffmpegVersion;+public bool IsVaapiDeviceAmd => _isVaapiDeviceAmd;+public bool IsVaapiDeviceInteliHD => _isVaapiDeviceInteliHD;+public bool IsVaapiDeviceInteli965 => _isVaapiDeviceInteli965;/// <summary>diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.csindex 89365a516c..5b1ec8041e 100644--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs@@ -139,28 +139,28 @@ namespace MediaBrowser.MediaEncoding.Subtitlesvar subtitle = await GetSubtitleStream(mediaSource, subtitleStream, cancellationToken).ConfigureAwait(false);- var inputFormat = subtitle.format;+ var inputFormat = subtitle.Format;// Return the original if we don't have any way of converting itif (!TryGetWriter(outputFormat, out var writer)){- return subtitle.stream;+ return subtitle.Stream;}// Return the original if the same format is being requested// Character encoding was already handled in GetSubtitleStreamif (string.Equals(inputFormat, outputFormat, StringComparison.OrdinalIgnoreCase)){- return subtitle.stream;+ return subtitle.Stream;}- using (var stream = subtitle.stream)+ using (var stream = subtitle.Stream){return ConvertSubtitles(stream, inputFormat, outputFormat, startTimeTicks, endTimeTicks, preserveOriginalTimestamps, cancellationToken);}}- private async Task<(Stream stream, string format)> GetSubtitleStream(+ private async Task<(Stream Stream, string Format)> GetSubtitleStream(MediaSourceInfo mediaSource,MediaStream subtitleStream,CancellationToken cancellationToken)diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.csindex a190172158..84a6f6abe3 100644--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs@@ -289,8 +289,8 @@ namespace MediaBrowser.Model.Dlnavar directPlayInfo = GetAudioDirectPlayMethods(item, audioStream, options);- var directPlayMethods = directPlayInfo.Item1;- var transcodeReasons = directPlayInfo.Item2.ToList();+ var directPlayMethods = directPlayInfo.PlayMethods;+ var transcodeReasons = directPlayInfo.TranscodeReasons.ToList();int? inputAudioChannels = audioStream?.Channels;int? inputAudioBitrate = audioStream?.BitDepth;@@ -448,7 +448,7 @@ namespace MediaBrowser.Model.Dlnareturn options.GetMaxBitrate(isAudio);}- private (IEnumerable<PlayMethod>, IEnumerable<TranscodeReason>) GetAudioDirectPlayMethods(MediaSourceInfo item, MediaStream audioStream, AudioOptions options)+ private (IEnumerable<PlayMethod> PlayMethods, IEnumerable<TranscodeReason> TranscodeReasons) GetAudioDirectPlayMethods(MediaSourceInfo item, MediaStream audioStream, AudioOptions options){DirectPlayProfile directPlayProfile = options.Profile.DirectPlayProfiles.FirstOrDefault(x => x.Type == DlnaProfileType.Audio && IsAudioDirectPlaySupported(x, item, audioStream));@@ -679,8 +679,8 @@ namespace MediaBrowser.Model.Dlna// TODO: This doesn't account for situations where the device is able to handle the media's bitrate, but the connection isn't fast enoughvar directPlayEligibilityResult = IsEligibleForDirectPlay(item, GetBitrateForDirectPlayCheck(item, options, true) ?? 0, subtitleStream, audioStream, options, PlayMethod.DirectPlay);var directStreamEligibilityResult = IsEligibleForDirectPlay(item, options.GetMaxBitrate(false) ?? 0, subtitleStream, audioStream, options, PlayMethod.DirectStream);- bool isEligibleForDirectPlay = options.EnableDirectPlay && (options.ForceDirectPlay || directPlayEligibilityResult.directPlay);- bool isEligibleForDirectStream = options.EnableDirectStream && (options.ForceDirectStream || directStreamEligibilityResult.directPlay);+ bool isEligibleForDirectPlay = options.EnableDirectPlay && (options.ForceDirectPlay || directPlayEligibilityResult.DirectPlay);+ bool isEligibleForDirectStream = options.EnableDirectStream && (options.ForceDirectStream || directStreamEligibilityResult.DirectPlay);_logger.LogDebug("Profile: {0}, Path: {1}, isEligibleForDirectPlay: {2}, isEligibleForDirectStream: {3}",@@ -695,7 +695,7 @@ namespace MediaBrowser.Model.Dlna{// See if it can be direct playedvar directPlayInfo = GetVideoDirectPlayProfile(options, item, videoStream, audioStream, isEligibleForDirectStream);- var directPlay = directPlayInfo.playMethod;+ var directPlay = directPlayInfo.PlayMethod;if (directPlay != null){@@ -713,17 +713,17 @@ namespace MediaBrowser.Model.Dlnareturn playlistItem;}- transcodeReasons.AddRange(directPlayInfo.transcodeReasons);+ transcodeReasons.AddRange(directPlayInfo.TranscodeReasons);}- if (directPlayEligibilityResult.reason.HasValue)+ if (directPlayEligibilityResult.Reason.HasValue){- transcodeReasons.Add(directPlayEligibilityResult.reason.Value);+ transcodeReasons.Add(directPlayEligibilityResult.Reason.Value);}- if (directStreamEligibilityResult.reason.HasValue)+ if (directStreamEligibilityResult.Reason.HasValue){- transcodeReasons.Add(directStreamEligibilityResult.reason.Value);+ transcodeReasons.Add(directStreamEligibilityResult.Reason.Value);}// Can't direct play, find the transcoding profile@@ -1000,7 +1000,7 @@ namespace MediaBrowser.Model.Dlnareturn 7168000;}- private (PlayMethod? playMethod, List<TranscodeReason> transcodeReasons) GetVideoDirectPlayProfile(+ private (PlayMethod? PlayMethod, List<TranscodeReason> TranscodeReasons) GetVideoDirectPlayProfile(VideoOptions options,MediaSourceInfo mediaSource,MediaStream videoStream,@@ -1209,7 +1209,7 @@ namespace MediaBrowser.Model.DlnamediaSource.Path ?? "Unknown path");}- private (bool directPlay, TranscodeReason? reason) IsEligibleForDirectPlay(+ private (bool DirectPlay, TranscodeReason? Reason) IsEligibleForDirectPlay(MediaSourceInfo item,long maxBitrate,MediaStream subtitleStream,diff --git a/MediaBrowser.Model/Session/GeneralCommandType.cs b/MediaBrowser.Model/Session/GeneralCommandType.csindex c58fa9a6b9..166a6b4416 100644--- a/MediaBrowser.Model/Session/GeneralCommandType.cs+++ b/MediaBrowser.Model/Session/GeneralCommandType.cs@@ -39,7 +39,6 @@ namespace MediaBrowser.Model.SessionSetRepeatMode = 29,ChannelUp = 30,ChannelDown = 31,- SetMaxStreamingBitrate = 31,Guide = 32,ToggleStats = 33,PlayMediaSource = 34,@@ -48,6 +47,7 @@ namespace MediaBrowser.Model.SessionPlayState = 37,PlayNext = 38,ToggleOsdMenu = 39,- Play = 40+ Play = 40,+ SetMaxStreamingBitrate = 41}}diff --git a/MediaBrowser.Providers/Manager/MetadataService.cs b/MediaBrowser.Providers/Manager/MetadataService.csindex 0af76f75a0..94045b38b9 100644--- a/MediaBrowser.Providers/Manager/MetadataService.cs+++ b/MediaBrowser.Providers/Manager/MetadataService.cs@@ -682,12 +682,12 @@ namespace MediaBrowser.Providers.Manager{try{- await ProviderManager.SaveImage(item, remoteImage.url, remoteImage.type, null, cancellationToken).ConfigureAwait(false);+ await ProviderManager.SaveImage(item, remoteImage.Url, remoteImage.Type, null, cancellationToken).ConfigureAwait(false);refreshResult.UpdateType |= ItemUpdateType.ImageUpdate;}catch (HttpRequestException ex){- Logger.LogError(ex, "Could not save {ImageType} image: {Url}", Enum.GetName(remoteImage.type), remoteImage.url);+ Logger.LogError(ex, "Could not save {ImageType} image: {Url}", Enum.GetName(remoteImage.Type), remoteImage.Url);}}diff --git a/MediaBrowser.Providers/Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs b/MediaBrowser.Providers/Plugins/MusicBrainz/MusicBrainzAlbumProvider.csindex 8a32cb07ce..5ae5ff3bec 100644--- a/MediaBrowser.Providers/Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs+++ b/MediaBrowser.Providers/Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs@@ -303,7 +303,7 @@ namespace MediaBrowser.Providers.Musicreturn ReleaseResult.Parse(reader).FirstOrDefault();}- private static (string, string) ParseArtistCredit(XmlReader reader)+ private static (string Name, string ArtistId) ParseArtistCredit(XmlReader reader){reader.MoveToContent();reader.Read();@@ -345,7 +345,7 @@ namespace MediaBrowser.Providers.Musicreturn default;}- private static (string, string) ParseArtistNameCredit(XmlReader reader)+ private static (string Name, string ArtistId) ParseArtistNameCredit(XmlReader reader){reader.MoveToContent();reader.Read();@@ -388,7 +388,7 @@ namespace MediaBrowser.Providers.Musicreturn (null, null);}- private static (string name, string id) ParseArtistArtistCredit(XmlReader reader, string artistId)+ private static (string Name, string ArtistId) ParseArtistArtistCredit(XmlReader reader, string artistId){reader.MoveToContent();reader.Read();@@ -628,7 +628,7 @@ namespace MediaBrowser.Providers.Musicpublic string Overview;public int? Year;- public List<ValueTuple<string, string>> Artists = new List<ValueTuple<string, string>>();+ public List<(string, string)> Artists = new();public static IEnumerable<ReleaseResult> Parse(XmlReader reader){@@ -776,7 +776,7 @@ namespace MediaBrowser.Providers.Musicusing var subReader = reader.ReadSubtree();var artist = ParseArtistCredit(subReader);- if (!string.IsNullOrEmpty(artist.Item1))+ if (!string.IsNullOrEmpty(artist.Name)){result.Artists.Add(artist);}diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.csindex bcf9a83661..0071018681 100644--- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs+++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs@@ -872,7 +872,7 @@ namespace MediaBrowser.XbmcMetadata.Parserselse{// only allow one item of each type- if (itemResult.RemoteImages.Any(x => x.type == imageType))+ if (itemResult.RemoteImages.Any(x => x.Type == imageType)){return;}diff --git a/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs b/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.csindex 7ea45d14d0..7c99520308 100644--- a/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs+++ b/tests/Jellyfin.XbmcMetadata.Tests/Parsers/MovieNfoParserTests.cs@@ -1,4 +1,5 @@using System;+using System.Collections.Generic;using System.Linq;using System.Threading;using Jellyfin.Data.Entities;@@ -157,33 +158,33 @@ namespace Jellyfin.XbmcMetadata.Tests.Parsers// ImagesAssert.Equal(7, result.RemoteImages.Count);- var posters = result.RemoteImages.Where(x => x.type == ImageType.Primary).ToList();+ var posters = result.RemoteImages.Where(x => x.Type == ImageType.Primary).ToList();Assert.Single(posters);- Assert.Equal("http://image.tmdb.org/t/p/original/9rtrRGeRnL0JKtu9IMBWsmlmmZz.jpg", posters[0].url);+ Assert.Equal("http://image.tmdb.org/t/p/original/9rtrRGeRnL0JKtu9IMBWsmlmmZz.jpg", posters[0].Url);- var logos = result.RemoteImages.Where(x => x.type == ImageType.Logo).ToList();+ var logos = result.RemoteImages.Where(x => x.Type == ImageType.Logo).ToList();Assert.Single(logos);- Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/hdmovielogo/justice-league-5865bf95cbadb.png", logos[0].url);+ Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/hdmovielogo/justice-league-5865bf95cbadb.png", logos[0].Url);- var banners = result.RemoteImages.Where(x => x.type == ImageType.Banner).ToList();+ var banners = result.RemoteImages.Where(x => x.Type == ImageType.Banner).ToList();Assert.Single(banners);- Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/moviebanner/justice-league-586017e95adbd.jpg", banners[0].url);+ Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/moviebanner/justice-league-586017e95adbd.jpg", banners[0].Url);- var thumbs = result.RemoteImages.Where(x => x.type == ImageType.Thumb).ToList();+ var thumbs = result.RemoteImages.Where(x => x.Type == ImageType.Thumb).ToList();Assert.Single(thumbs);- Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/moviethumb/justice-league-585fb155c3743.jpg", thumbs[0].url);+ Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/moviethumb/justice-league-585fb155c3743.jpg", thumbs[0].Url);- var art = result.RemoteImages.Where(x => x.type == ImageType.Art).ToList();+ var art = result.RemoteImages.Where(x => x.Type == ImageType.Art).ToList();Assert.Single(art);- Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/hdmovieclearart/justice-league-5865c23193041.png", art[0].url);+ Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/hdmovieclearart/justice-league-5865c23193041.png", art[0].Url);- var discArt = result.RemoteImages.Where(x => x.type == ImageType.Disc).ToList();+ var discArt = result.RemoteImages.Where(x => x.Type == ImageType.Disc).ToList();Assert.Single(discArt);- Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/moviedisc/justice-league-5a3af26360617.png", discArt[0].url);+ Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/moviedisc/justice-league-5a3af26360617.png", discArt[0].Url);- var backdrop = result.RemoteImages.Where(x => x.type == ImageType.Backdrop).ToList();+ var backdrop = result.RemoteImages.Where(x => x.Type == ImageType.Backdrop).ToList();Assert.Single(backdrop);- Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/moviebackground/justice-league-5793f518c6d6e.jpg", backdrop[0].url);+ Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/moviebackground/justice-league-5793f518c6d6e.jpg", backdrop[0].Url);// Local Image - contains only one item depending on operating systemAssert.Single(result.Images);@@ -216,8 +217,8 @@ namespace Jellyfin.XbmcMetadata.Tests.Parsers_parser.Fetch(result, "Test Data/Fanart.nfo", CancellationToken.None);- Assert.Single(result.RemoteImages.Where(x => x.type == ImageType.Backdrop));- Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/moviebackground/justice-league-5a5332c7b5e77.jpg", result.RemoteImages.First(x => x.type == ImageType.Backdrop).url);+ Assert.Single(result.RemoteImages.Where(x => x.Type == ImageType.Backdrop));+ Assert.Equal("https://assets.fanart.tv/fanart/movies/141052/moviebackground/justice-league-5a5332c7b5e77.jpg", result.RemoteImages.First(x => x.Type == ImageType.Backdrop).Url);}[Fact]