mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
stub out channel mapping
This commit is contained in:
parent
2538889943
commit
e2ffb0ba25
@ -402,47 +402,31 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||||||
public static IEnumerable<Episode> FilterEpisodesBySeason(IEnumerable<Episode> episodes, Season parentSeason, bool includeSpecials)
|
public static IEnumerable<Episode> FilterEpisodesBySeason(IEnumerable<Episode> episodes, Season parentSeason, bool includeSpecials)
|
||||||
{
|
{
|
||||||
var seasonNumber = parentSeason.IndexNumber;
|
var seasonNumber = parentSeason.IndexNumber;
|
||||||
if (!includeSpecials || (seasonNumber.HasValue && seasonNumber.Value == 0))
|
var seasonPresentationKey = parentSeason.PresentationUniqueKey;
|
||||||
|
|
||||||
|
var supportSpecialsInSeason = includeSpecials && seasonNumber.HasValue && seasonNumber.Value != 0;
|
||||||
|
|
||||||
|
return episodes.Where(episode =>
|
||||||
{
|
{
|
||||||
var seasonPresentationKey = parentSeason.PresentationUniqueKey;
|
var currentSeasonNumber = supportSpecialsInSeason ? episode.AiredSeasonNumber : episode.ParentIndexNumber;
|
||||||
|
if (currentSeasonNumber.HasValue && seasonNumber.HasValue && currentSeasonNumber.Value == seasonNumber.Value)
|
||||||
return episodes.Where(i =>
|
|
||||||
{
|
{
|
||||||
if ((i.ParentIndexNumber ?? -1) == seasonNumber)
|
return true;
|
||||||
{
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!i.ParentIndexNumber.HasValue)
|
|
||||||
{
|
|
||||||
var season = i.Season;
|
|
||||||
return season != null && string.Equals(season.PresentationUniqueKey, seasonPresentationKey, StringComparison.OrdinalIgnoreCase);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
if (!currentSeasonNumber.HasValue && !seasonNumber.HasValue && parentSeason.LocationType == LocationType.Virtual)
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var seasonPresentationKey = parentSeason.PresentationUniqueKey;
|
|
||||||
|
|
||||||
return episodes.Where(episode =>
|
|
||||||
{
|
{
|
||||||
var currentSeasonNumber = episode.AiredSeasonNumber;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (currentSeasonNumber.HasValue && seasonNumber.HasValue && currentSeasonNumber.Value == seasonNumber.Value)
|
if (!episode.ParentIndexNumber.HasValue)
|
||||||
{
|
{
|
||||||
return true;
|
var season = episode.Season;
|
||||||
}
|
return season != null && string.Equals(season.PresentationUniqueKey, seasonPresentationKey, StringComparison.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
if (!episode.ParentIndexNumber.HasValue)
|
return false;
|
||||||
{
|
});
|
||||||
var season = episode.Season;
|
|
||||||
return season != null && string.Equals(season.PresentationUniqueKey, seasonPresentationKey, StringComparison.OrdinalIgnoreCase);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool GetBlockUnratedValue(UserPolicy config)
|
protected override bool GetBlockUnratedValue(UserPolicy config)
|
||||||
|
@ -15,5 +15,6 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
Task AddMetadata(ListingsProviderInfo info, List<ChannelInfo> channels, CancellationToken cancellationToken);
|
Task AddMetadata(ListingsProviderInfo info, List<ChannelInfo> channels, CancellationToken cancellationToken);
|
||||||
Task Validate(ListingsProviderInfo info, bool validateLogin, bool validateListings);
|
Task Validate(ListingsProviderInfo info, bool validateLogin, bool validateListings);
|
||||||
Task<List<NameIdPair>> GetLineups(ListingsProviderInfo info, string country, string location);
|
Task<List<NameIdPair>> GetLineups(ListingsProviderInfo info, string country, string location);
|
||||||
|
Task<List<ChannelInfo>> GetChannels(ListingsProviderInfo info, CancellationToken cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -385,5 +385,7 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
List<NameValuePair> GetSatIniMappings();
|
List<NameValuePair> GetSatIniMappings();
|
||||||
|
|
||||||
Task<List<ChannelInfo>> GetSatChannelScanResult(TunerHostInfo info, CancellationToken cancellationToken);
|
Task<List<ChannelInfo>> GetSatChannelScanResult(TunerHostInfo info, CancellationToken cancellationToken);
|
||||||
|
|
||||||
|
Task<List<ChannelInfo>> GetChannelsFromListingsProvider(string id, CancellationToken cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -869,6 +869,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
|
|||||||
return GetHeadends(info, country, location, CancellationToken.None);
|
return GetHeadends(info, country, location, CancellationToken.None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<ChannelInfo>> GetChannels(ListingsProviderInfo info, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return new List<ChannelInfo>();
|
||||||
|
}
|
||||||
|
|
||||||
public class ScheduleDirect
|
public class ScheduleDirect
|
||||||
{
|
{
|
||||||
public class Token
|
public class Token
|
||||||
|
@ -144,5 +144,10 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
|
|||||||
// Should this method be async?
|
// Should this method be async?
|
||||||
return Task.FromResult(results.Select(c => new NameIdPair() { Id = c.Id, Name = c.DisplayName }).ToList());
|
return Task.FromResult(results.Select(c => new NameIdPair() { Id = c.Id, Name = c.DisplayName }).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<ChannelInfo>> GetChannels(ListingsProviderInfo info, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return new List<ChannelInfo>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2521,5 +2521,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||||||
{
|
{
|
||||||
return new TunerHosts.SatIp.ChannelScan(_logger).Scan(info, cancellationToken);
|
return new TunerHosts.SatIp.ChannelScan(_logger).Scan(info, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task<List<ChannelInfo>> GetChannelsFromListingsProvider(string id, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var info = GetConfiguration().ListingProviders.First(i => string.Equals(i.Id, id, StringComparison.OrdinalIgnoreCase));
|
||||||
|
var provider = _listingProviders.First(i => string.Equals(i.Type, info.Type, StringComparison.OrdinalIgnoreCase));
|
||||||
|
return provider.GetChannels(info, cancellationToken);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user