mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-19 12:44:19 +01:00
Update to Jellyfin.XmlTv 10.12.0-pre1
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
<PackageVersion Include="ICU4N.Transliterator" Version="60.1.0-alpha.356" />
|
<PackageVersion Include="ICU4N.Transliterator" Version="60.1.0-alpha.356" />
|
||||||
<PackageVersion Include="IDisposableAnalyzers" Version="4.0.8" />
|
<PackageVersion Include="IDisposableAnalyzers" Version="4.0.8" />
|
||||||
<PackageVersion Include="Ignore" Version="0.2.1" />
|
<PackageVersion Include="Ignore" Version="0.2.1" />
|
||||||
<PackageVersion Include="Jellyfin.XmlTv" Version="10.8.0" />
|
<PackageVersion Include="Jellyfin.XmlTv" Version="10.12.0-pre1" />
|
||||||
<PackageVersion Include="libse" Version="4.0.12" />
|
<PackageVersion Include="libse" Version="4.0.12" />
|
||||||
<PackageVersion Include="LrcParser" Version="2025.623.0" />
|
<PackageVersion Include="LrcParser" Version="2025.623.0" />
|
||||||
<PackageVersion Include="MetaBrainz.MusicBrainz" Version="8.0.1" />
|
<PackageVersion Include="MetaBrainz.MusicBrainz" Version="8.0.1" />
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#nullable disable
|
|
||||||
|
|
||||||
#pragma warning disable CS1591
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@@ -12,45 +10,45 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
{
|
{
|
||||||
public ProgramInfo()
|
public ProgramInfo()
|
||||||
{
|
{
|
||||||
Genres = new List<string>();
|
Genres = [];
|
||||||
|
|
||||||
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
ProviderIds = new Dictionary<string, string?>(StringComparer.OrdinalIgnoreCase);
|
||||||
SeriesProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
SeriesProviderIds = new Dictionary<string, string?>(StringComparer.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the id of the program.
|
/// Gets or sets the id of the program.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Id { get; set; }
|
public string? Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the channel identifier.
|
/// Gets or sets the channel identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The channel identifier.</value>
|
/// <value>The channel identifier.</value>
|
||||||
public string ChannelId { get; set; }
|
public string? ChannelId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the name of the program.
|
/// Gets or sets the name of the program.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string? Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the official rating.
|
/// Gets or sets the official rating.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The official rating.</value>
|
/// <value>The official rating.</value>
|
||||||
public string OfficialRating { get; set; }
|
public string? OfficialRating { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the overview.
|
/// Gets or sets the overview.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The overview.</value>
|
/// <value>The overview.</value>
|
||||||
public string Overview { get; set; }
|
public string? Overview { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the short overview.
|
/// Gets or sets the short overview.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The short overview.</value>
|
/// <value>The short overview.</value>
|
||||||
public string ShortOverview { get; set; }
|
public string? ShortOverview { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the start date of the program, in UTC.
|
/// Gets or sets the start date of the program, in UTC.
|
||||||
@@ -108,25 +106,25 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
/// Gets or sets the episode title.
|
/// Gets or sets the episode title.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The episode title.</value>
|
/// <value>The episode title.</value>
|
||||||
public string EpisodeTitle { get; set; }
|
public string? EpisodeTitle { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the image path if it can be accessed directly from the file system.
|
/// Gets or sets the image path if it can be accessed directly from the file system.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The image path.</value>
|
/// <value>The image path.</value>
|
||||||
public string ImagePath { get; set; }
|
public string? ImagePath { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the image url if it can be downloaded.
|
/// Gets or sets the image url if it can be downloaded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The image URL.</value>
|
/// <value>The image URL.</value>
|
||||||
public string ImageUrl { get; set; }
|
public string? ImageUrl { get; set; }
|
||||||
|
|
||||||
public string ThumbImageUrl { get; set; }
|
public string? ThumbImageUrl { get; set; }
|
||||||
|
|
||||||
public string LogoImageUrl { get; set; }
|
public string? LogoImageUrl { get; set; }
|
||||||
|
|
||||||
public string BackdropImageUrl { get; set; }
|
public string? BackdropImageUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether this instance has image.
|
/// Gets or sets a value indicating whether this instance has image.
|
||||||
@@ -188,19 +186,19 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
/// Gets or sets the home page URL.
|
/// Gets or sets the home page URL.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The home page URL.</value>
|
/// <value>The home page URL.</value>
|
||||||
public string HomePageUrl { get; set; }
|
public string? HomePageUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the series identifier.
|
/// Gets or sets the series identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The series identifier.</value>
|
/// <value>The series identifier.</value>
|
||||||
public string SeriesId { get; set; }
|
public string? SeriesId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the show identifier.
|
/// Gets or sets the show identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The show identifier.</value>
|
/// <value>The show identifier.</value>
|
||||||
public string ShowId { get; set; }
|
public string? ShowId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the season number.
|
/// Gets or sets the season number.
|
||||||
@@ -218,10 +216,10 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
/// Gets or sets the etag.
|
/// Gets or sets the etag.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The etag.</value>
|
/// <value>The etag.</value>
|
||||||
public string Etag { get; set; }
|
public string? Etag { get; set; }
|
||||||
|
|
||||||
public Dictionary<string, string> ProviderIds { get; set; }
|
public Dictionary<string, string?> ProviderIds { get; set; }
|
||||||
|
|
||||||
public Dictionary<string, string> SeriesProviderIds { get; set; }
|
public Dictionary<string, string?> SeriesProviderIds { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#nullable disable
|
|
||||||
|
|
||||||
#pragma warning disable CS1591
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@@ -62,21 +60,21 @@ namespace Jellyfin.LiveTv.Listings
|
|||||||
_logger.LogInformation("xmltv path: {Path}", info.Path);
|
_logger.LogInformation("xmltv path: {Path}", info.Path);
|
||||||
|
|
||||||
string cacheFilename = info.Id + ".xml";
|
string cacheFilename = info.Id + ".xml";
|
||||||
string cacheFile = Path.Combine(_config.ApplicationPaths.CachePath, "xmltv", cacheFilename);
|
string cacheDir = Path.Join(_config.ApplicationPaths.CachePath, "xmltv");
|
||||||
|
string cacheFile = Path.Join(cacheDir, cacheFilename);
|
||||||
|
|
||||||
if (File.Exists(cacheFile) && File.GetLastWriteTimeUtc(cacheFile) >= DateTime.UtcNow.Subtract(_maxCacheAge))
|
|
||||||
{
|
|
||||||
return cacheFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Must check if file exists as parent directory may not exist.
|
|
||||||
if (File.Exists(cacheFile))
|
if (File.Exists(cacheFile))
|
||||||
{
|
{
|
||||||
|
if (File.GetLastWriteTimeUtc(cacheFile) >= DateTime.UtcNow.Subtract(_maxCacheAge))
|
||||||
|
{
|
||||||
|
return cacheFile;
|
||||||
|
}
|
||||||
|
|
||||||
File.Delete(cacheFile);
|
File.Delete(cacheFile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(cacheFile));
|
Directory.CreateDirectory(cacheDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.Path.StartsWith("http", StringComparison.OrdinalIgnoreCase))
|
if (info.Path.StartsWith("http", StringComparison.OrdinalIgnoreCase))
|
||||||
@@ -154,22 +152,25 @@ namespace Jellyfin.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 programCategories = program.Categories.Where(c => !string.IsNullOrWhiteSpace(c)).ToList();
|
||||||
|
var imageUrl = program.Icons.FirstOrDefault()?.Source;
|
||||||
|
var rating = program.Ratings.FirstOrDefault()?.Value;
|
||||||
|
var starRating = program.StarRatings?.FirstOrDefault()?.StarRating;
|
||||||
|
|
||||||
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 = programCategories,
|
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,
|
SeasonNumber = program.Episode?.Series,
|
||||||
IsSeries = program.Episode.Episode is not null,
|
IsSeries = program.Episode?.Episode 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,
|
||||||
IsLive = program.IsLive,
|
IsLive = program.IsLive,
|
||||||
@@ -177,11 +178,11 @@ namespace Jellyfin.LiveTv.Listings
|
|||||||
IsMovie = programCategories.Any(c => info.MovieCategories.Contains(c, StringComparison.OrdinalIgnoreCase)),
|
IsMovie = programCategories.Any(c => info.MovieCategories.Contains(c, StringComparison.OrdinalIgnoreCase)),
|
||||||
IsNews = programCategories.Any(c => info.NewsCategories.Contains(c, StringComparison.OrdinalIgnoreCase)),
|
IsNews = programCategories.Any(c => info.NewsCategories.Contains(c, StringComparison.OrdinalIgnoreCase)),
|
||||||
IsSports = programCategories.Any(c => info.SportsCategories.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(imageUrl) ? null : imageUrl,
|
||||||
HasImage = !string.IsNullOrEmpty(program.Icon?.Source),
|
HasImage = !string.IsNullOrEmpty(imageUrl),
|
||||||
OfficialRating = string.IsNullOrEmpty(program.Rating?.Value) ? null : program.Rating.Value,
|
OfficialRating = string.IsNullOrEmpty(rating) ? null : rating,
|
||||||
CommunityRating = program.StarRating,
|
CommunityRating = starRating is null ? null : (float)starRating.Value,
|
||||||
SeriesId = program.Episode.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))
|
||||||
@@ -262,7 +263,7 @@ namespace Jellyfin.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.Icons.FirstOrDefault()?.Source) ? null : c.Icons.FirstOrDefault()!.Source,
|
||||||
Number = string.IsNullOrWhiteSpace(c.Number) ? c.Id : c.Number
|
Number = string.IsNullOrWhiteSpace(c.Number) ? c.Id : c.Number
|
||||||
}).ToList();
|
}).ToList();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user