mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-11 18:20:23 +01:00
update tv
This commit is contained in:
@@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings.Emby
|
||||
|
||||
public Task<List<NameIdPair>> GetLineups(ListingsProviderInfo info, string country, string location)
|
||||
{
|
||||
return GetListingsProvider(country).GetLineups(info, country, location);
|
||||
return GetListingsProvider(country).GetLineups(country, location);
|
||||
}
|
||||
|
||||
private IEmbyListingProvider GetListingsProvider(string country)
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings.Emby
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
public async Task<List<NameIdPair>> GetLineups(ListingsProviderInfo info, string country, string location)
|
||||
public async Task<List<NameIdPair>> GetLineups(string country, string location)
|
||||
{
|
||||
// location = postal code
|
||||
var path = await GetResponse<String>("https://data.emby.media/service/lineups?postalCode=" + location).ConfigureAwait(false);
|
||||
|
||||
@@ -13,6 +13,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings.Emby
|
||||
Task<IEnumerable<ProgramInfo>> GetProgramsAsync(ListingsProviderInfo info, string channelNumber, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken);
|
||||
Task AddMetadata(ListingsProviderInfo info, List<ChannelInfo> channels, CancellationToken cancellationToken);
|
||||
Task Validate(ListingsProviderInfo info, bool validateLogin, bool validateListings);
|
||||
Task<List<NameIdPair>> GetLineups(ListingsProviderInfo info, string country, string location);
|
||||
Task<List<NameIdPair>> GetLineups(string country, string location);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2272,20 +2272,34 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
return info;
|
||||
}
|
||||
|
||||
public Task<List<NameIdPair>> GetLineups(string providerId, string country, string location)
|
||||
public Task<List<NameIdPair>> GetLineups(string providerType, string providerId, string country, string location)
|
||||
{
|
||||
var config = GetConfiguration();
|
||||
|
||||
var info = config.ListingProviders.FirstOrDefault(i => string.Equals(i.Id, providerId, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
var provider = _listingProviders.FirstOrDefault(i => string.Equals(info.Type, i.Type, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (provider == null)
|
||||
if (string.IsNullOrWhiteSpace(providerId))
|
||||
{
|
||||
throw new ResourceNotFoundException();
|
||||
}
|
||||
var provider = _listingProviders.FirstOrDefault(i => string.Equals(providerType, i.Type, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
return provider.GetLineups(info, country, location);
|
||||
if (provider == null)
|
||||
{
|
||||
throw new ResourceNotFoundException();
|
||||
}
|
||||
|
||||
return provider.GetLineups(null, country, location);
|
||||
}
|
||||
else
|
||||
{
|
||||
var info = config.ListingProviders.FirstOrDefault(i => string.Equals(i.Id, providerId, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
var provider = _listingProviders.FirstOrDefault(i => string.Equals(info.Type, i.Type, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (provider == null)
|
||||
{
|
||||
throw new ResourceNotFoundException();
|
||||
}
|
||||
|
||||
return provider.GetLineups(info, country, location);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user