The Free Software Media System - Server Backend & API
Use ValueTuple in GetListingsProviders
Patrick Barron1c11c460b94c
diff --git a/src/Jellyfin.LiveTv/Listings/ListingsManager.cs b/src/Jellyfin.LiveTv/Listings/ListingsManager.csindex 113979257d..9b239f7e43 100644--- a/src/Jellyfin.LiveTv/Listings/ListingsManager.cs+++ b/src/Jellyfin.LiveTv/Listings/ListingsManager.cs@@ -7,7 +7,6 @@ using System.Text.Json;using System.Threading;using System.Threading.Tasks;using Jellyfin.LiveTv.Configuration;-using Jellyfin.LiveTv.EmbyTV;using Jellyfin.LiveTv.Guide;using MediaBrowser.Common.Configuration;using MediaBrowser.Common.Extensions;@@ -267,16 +266,13 @@ public class ListingsManager : IListingsManagerreturn tunerChannelMappings.First(i => string.Equals(i.Id, tunerChannelNumber, StringComparison.OrdinalIgnoreCase));}- private List<Tuple<IListingsProvider, ListingsProviderInfo>> GetListingProviders()+ private List<(IListingsProvider Provider, ListingsProviderInfo ProviderInfo)> GetListingProviders()=> _config.GetLiveTvConfiguration().ListingProviders- .Select(i =>- {- var provider = _listingsProviders- .FirstOrDefault(l => string.Equals(l.Type, i.Type, StringComparison.OrdinalIgnoreCase));-- return provider is null ? null : new Tuple<IListingsProvider, ListingsProviderInfo>(provider, i);- })- .Where(i => i is not null)+ .Select(info => (+ Provider: _listingsProviders.FirstOrDefault(l+ => string.Equals(l.Type, info.Type, StringComparison.OrdinalIgnoreCase)),+ ProviderInfo: info))+ .Where(i => i.Provider is not null).ToList()!; // Already filtered out nullprivate async Task AddMetadata(