Use ValueTuple in GetListingsProviders

pull/10981/head
Patrick Barron 4 months ago
parent 1a24d26dac
commit 1c11c460b9

@ -7,7 +7,6 @@ using System.Text.Json;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Jellyfin.LiveTv.Configuration; using Jellyfin.LiveTv.Configuration;
using Jellyfin.LiveTv.EmbyTV;
using Jellyfin.LiveTv.Guide; using Jellyfin.LiveTv.Guide;
using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Extensions;
@ -267,16 +266,13 @@ public class ListingsManager : IListingsManager
return tunerChannelMappings.First(i => string.Equals(i.Id, tunerChannelNumber, StringComparison.OrdinalIgnoreCase)); return 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 => _config.GetLiveTvConfiguration().ListingProviders
.Select(i => .Select(info => (
{ Provider: _listingsProviders.FirstOrDefault(l
var provider = _listingsProviders => string.Equals(l.Type, info.Type, StringComparison.OrdinalIgnoreCase)),
.FirstOrDefault(l => string.Equals(l.Type, i.Type, StringComparison.OrdinalIgnoreCase)); ProviderInfo: info))
.Where(i => i.Provider is not null)
return provider is null ? null : new Tuple<IListingsProvider, ListingsProviderInfo>(provider, i);
})
.Where(i => i is not null)
.ToList()!; // Already filtered out null .ToList()!; // Already filtered out null
private async Task AddMetadata( private async Task AddMetadata(

Loading…
Cancel
Save