|
@@ -137,32 +137,33 @@ namespace Emby.Server.Implementations.LiveTv.Listings
|
|
|
|
|
|
private static ProgramInfo GetProgramInfo(XmlTvProgram program, ListingsProviderInfo info)
|
|
private static ProgramInfo GetProgramInfo(XmlTvProgram program, ListingsProviderInfo info)
|
|
{
|
|
{
|
|
- string episodeTitle = program.Episode?.Title;
|
|
|
|
|
|
+ string episodeTitle = program.Episode.Title;
|
|
|
|
+ var programCategories = program.Categories.Where(c => !string.IsNullOrWhiteSpace(c)).ToList();
|
|
|
|
|
|
var programInfo = new ProgramInfo
|
|
var programInfo = new ProgramInfo
|
|
{
|
|
{
|
|
ChannelId = program.ChannelId,
|
|
ChannelId = program.ChannelId,
|
|
EndDate = program.EndDate.UtcDateTime,
|
|
EndDate = program.EndDate.UtcDateTime,
|
|
- EpisodeNumber = program.Episode?.Episode,
|
|
|
|
|
|
+ EpisodeNumber = program.Episode.Episode,
|
|
EpisodeTitle = episodeTitle,
|
|
EpisodeTitle = episodeTitle,
|
|
- Genres = program.Categories,
|
|
|
|
|
|
+ Genres = programCategories,
|
|
StartDate = program.StartDate.UtcDateTime,
|
|
StartDate = program.StartDate.UtcDateTime,
|
|
Name = program.Title,
|
|
Name = program.Title,
|
|
Overview = program.Description,
|
|
Overview = program.Description,
|
|
ProductionYear = program.CopyrightDate?.Year,
|
|
ProductionYear = program.CopyrightDate?.Year,
|
|
- SeasonNumber = program.Episode?.Series,
|
|
|
|
- IsSeries = program.Episode is not null,
|
|
|
|
|
|
+ SeasonNumber = program.Episode.Series,
|
|
|
|
+ IsSeries = program.Episode.Series is not null,
|
|
IsRepeat = program.IsPreviouslyShown && !program.IsNew,
|
|
IsRepeat = program.IsPreviouslyShown && !program.IsNew,
|
|
IsPremiere = program.Premiere is not null,
|
|
IsPremiere = program.Premiere is not null,
|
|
- IsKids = program.Categories.Any(c => info.KidsCategories.Contains(c, StringComparison.OrdinalIgnoreCase)),
|
|
|
|
- IsMovie = program.Categories.Any(c => info.MovieCategories.Contains(c, StringComparison.OrdinalIgnoreCase)),
|
|
|
|
- IsNews = program.Categories.Any(c => info.NewsCategories.Contains(c, StringComparison.OrdinalIgnoreCase)),
|
|
|
|
- IsSports = program.Categories.Any(c => info.SportsCategories.Contains(c, StringComparison.OrdinalIgnoreCase)),
|
|
|
|
|
|
+ IsKids = programCategories.Any(c => info.KidsCategories.Contains(c, StringComparison.OrdinalIgnoreCase)),
|
|
|
|
+ IsMovie = programCategories.Any(c => info.MovieCategories.Contains(c, StringComparison.OrdinalIgnoreCase)),
|
|
|
|
+ IsNews = programCategories.Any(c => info.NewsCategories.Contains(c, StringComparison.OrdinalIgnoreCase)),
|
|
|
|
+ IsSports = programCategories.Any(c => info.SportsCategories.Contains(c, StringComparison.OrdinalIgnoreCase)),
|
|
ImageUrl = string.IsNullOrEmpty(program.Icon?.Source) ? null : program.Icon.Source,
|
|
ImageUrl = string.IsNullOrEmpty(program.Icon?.Source) ? null : program.Icon.Source,
|
|
HasImage = !string.IsNullOrEmpty(program.Icon?.Source),
|
|
HasImage = !string.IsNullOrEmpty(program.Icon?.Source),
|
|
OfficialRating = string.IsNullOrEmpty(program.Rating?.Value) ? null : program.Rating.Value,
|
|
OfficialRating = string.IsNullOrEmpty(program.Rating?.Value) ? null : program.Rating.Value,
|
|
CommunityRating = program.StarRating,
|
|
CommunityRating = program.StarRating,
|
|
- SeriesId = program.Episode is null ? null : program.Title?.GetMD5().ToString("N", CultureInfo.InvariantCulture)
|
|
|
|
|
|
+ SeriesId = program.Episode.Episode is null ? null : program.Title?.GetMD5().ToString("N", CultureInfo.InvariantCulture)
|
|
};
|
|
};
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(program.ProgramId))
|
|
if (string.IsNullOrWhiteSpace(program.ProgramId))
|
|
@@ -243,7 +244,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
|
|
{
|
|
{
|
|
Id = c.Id,
|
|
Id = c.Id,
|
|
Name = c.DisplayName,
|
|
Name = c.DisplayName,
|
|
- ImageUrl = string.IsNullOrEmpty(c.Icon.Source) ? null : c.Icon.Source,
|
|
|
|
|
|
+ ImageUrl = string.IsNullOrEmpty(c.Icon?.Source) ? null : c.Icon.Source,
|
|
Number = string.IsNullOrWhiteSpace(c.Number) ? c.Id : c.Number
|
|
Number = string.IsNullOrWhiteSpace(c.Number) ? c.Id : c.Number
|
|
}).ToList();
|
|
}).ToList();
|
|
}
|
|
}
|