|
|
|
@ -22,9 +22,9 @@ namespace ErsatzTV.Application.Channels; |
|
|
|
|
|
|
|
|
|
|
|
public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
private readonly IConfigElementRepository _configElementRepository; |
|
|
|
private readonly IDbContextFactory<TvContext> _dbContextFactory; |
|
|
|
private readonly IDbContextFactory<TvContext> _dbContextFactory; |
|
|
|
private readonly ILocalFileSystem _localFileSystem; |
|
|
|
private readonly ILocalFileSystem _localFileSystem; |
|
|
|
private readonly IConfigElementRepository _configElementRepository; |
|
|
|
|
|
|
|
private readonly ILogger<RefreshChannelDataHandler> _logger; |
|
|
|
private readonly ILogger<RefreshChannelDataHandler> _logger; |
|
|
|
private readonly RecyclableMemoryStreamManager _recyclableMemoryStreamManager; |
|
|
|
private readonly RecyclableMemoryStreamManager _recyclableMemoryStreamManager; |
|
|
|
|
|
|
|
|
|
|
|
@ -367,7 +367,7 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
item, |
|
|
|
item, |
|
|
|
start, |
|
|
|
start, |
|
|
|
stop, |
|
|
|
stop, |
|
|
|
hasCustomTitle: false, |
|
|
|
false, |
|
|
|
templateContext, |
|
|
|
templateContext, |
|
|
|
movieTemplate, |
|
|
|
movieTemplate, |
|
|
|
episodeTemplate, |
|
|
|
episodeTemplate, |
|
|
|
@ -491,9 +491,9 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
{ |
|
|
|
{ |
|
|
|
ProgrammeStart = start, |
|
|
|
ProgrammeStart = start, |
|
|
|
ProgrammeStop = stop, |
|
|
|
ProgrammeStop = stop, |
|
|
|
ChannelNumber = request.ChannelNumber, |
|
|
|
request.ChannelNumber, |
|
|
|
HasCustomTitle = hasCustomTitle, |
|
|
|
HasCustomTitle = hasCustomTitle, |
|
|
|
CustomTitle = displayItem.CustomTitle, |
|
|
|
displayItem.CustomTitle, |
|
|
|
MovieTitle = title, |
|
|
|
MovieTitle = title, |
|
|
|
MovieHasPlot = !string.IsNullOrWhiteSpace(metadata.Plot), |
|
|
|
MovieHasPlot = !string.IsNullOrWhiteSpace(metadata.Plot), |
|
|
|
MoviePlot = metadata.Plot, |
|
|
|
MoviePlot = metadata.Plot, |
|
|
|
@ -546,9 +546,9 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
{ |
|
|
|
{ |
|
|
|
ProgrammeStart = start, |
|
|
|
ProgrammeStart = start, |
|
|
|
ProgrammeStop = stop, |
|
|
|
ProgrammeStop = stop, |
|
|
|
ChannelNumber = request.ChannelNumber, |
|
|
|
request.ChannelNumber, |
|
|
|
HasCustomTitle = hasCustomTitle, |
|
|
|
HasCustomTitle = hasCustomTitle, |
|
|
|
CustomTitle = displayItem.CustomTitle, |
|
|
|
displayItem.CustomTitle, |
|
|
|
ShowTitle = title, |
|
|
|
ShowTitle = title, |
|
|
|
EpisodeHasTitle = !string.IsNullOrWhiteSpace(subtitle), |
|
|
|
EpisodeHasTitle = !string.IsNullOrWhiteSpace(subtitle), |
|
|
|
EpisodeTitle = subtitle, |
|
|
|
EpisodeTitle = subtitle, |
|
|
|
@ -560,7 +560,7 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
EpisodeHasArtwork = !string.IsNullOrWhiteSpace(artworkPath), |
|
|
|
EpisodeHasArtwork = !string.IsNullOrWhiteSpace(artworkPath), |
|
|
|
EpisodeArtworkUrl = artworkPath, |
|
|
|
EpisodeArtworkUrl = artworkPath, |
|
|
|
SeasonNumber = templateEpisode.Season?.SeasonNumber ?? 0, |
|
|
|
SeasonNumber = templateEpisode.Season?.SeasonNumber ?? 0, |
|
|
|
EpisodeNumber = metadata.EpisodeNumber, |
|
|
|
metadata.EpisodeNumber, |
|
|
|
ShowHasContentRating = !string.IsNullOrWhiteSpace(showMetadata.ContentRating), |
|
|
|
ShowHasContentRating = !string.IsNullOrWhiteSpace(showMetadata.ContentRating), |
|
|
|
ShowContentRating = showMetadata.ContentRating, |
|
|
|
ShowContentRating = showMetadata.ContentRating, |
|
|
|
ShowGuids = showMetadata.Guids.Map(g => g.Guid), |
|
|
|
ShowGuids = showMetadata.Guids.Map(g => g.Guid), |
|
|
|
@ -606,9 +606,9 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
{ |
|
|
|
{ |
|
|
|
ProgrammeStart = start, |
|
|
|
ProgrammeStart = start, |
|
|
|
ProgrammeStop = stop, |
|
|
|
ProgrammeStop = stop, |
|
|
|
ChannelNumber = request.ChannelNumber, |
|
|
|
request.ChannelNumber, |
|
|
|
HasCustomTitle = hasCustomTitle, |
|
|
|
HasCustomTitle = hasCustomTitle, |
|
|
|
CustomTitle = displayItem.CustomTitle, |
|
|
|
displayItem.CustomTitle, |
|
|
|
ArtistTitle = title, |
|
|
|
ArtistTitle = title, |
|
|
|
MusicVideoTitle = subtitle, |
|
|
|
MusicVideoTitle = subtitle, |
|
|
|
MusicVideoHasPlot = !string.IsNullOrWhiteSpace(metadata.Plot), |
|
|
|
MusicVideoHasPlot = !string.IsNullOrWhiteSpace(metadata.Plot), |
|
|
|
@ -663,9 +663,9 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
{ |
|
|
|
{ |
|
|
|
ProgrammeStart = start, |
|
|
|
ProgrammeStart = start, |
|
|
|
ProgrammeStop = stop, |
|
|
|
ProgrammeStop = stop, |
|
|
|
ChannelNumber = request.ChannelNumber, |
|
|
|
request.ChannelNumber, |
|
|
|
HasCustomTitle = hasCustomTitle, |
|
|
|
HasCustomTitle = hasCustomTitle, |
|
|
|
CustomTitle = displayItem.CustomTitle, |
|
|
|
displayItem.CustomTitle, |
|
|
|
SongTitle = subtitle, |
|
|
|
SongTitle = subtitle, |
|
|
|
SongArtists = metadata.Artists, |
|
|
|
SongArtists = metadata.Artists, |
|
|
|
SongAlbumArtists = metadata.AlbumArtists, |
|
|
|
SongAlbumArtists = metadata.AlbumArtists, |
|
|
|
@ -682,7 +682,7 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
SongAlbum = metadata.Album, |
|
|
|
SongAlbum = metadata.Album, |
|
|
|
SongHasReleaseDate = metadata.ReleaseDate.HasValue, |
|
|
|
SongHasReleaseDate = metadata.ReleaseDate.HasValue, |
|
|
|
SongReleaseDate = metadata.ReleaseDate, |
|
|
|
SongReleaseDate = metadata.ReleaseDate, |
|
|
|
SongStudios = metadata.Studios.Map(s => s.Name), |
|
|
|
SongStudios = metadata.Studios.Map(s => s.Name) |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var scriptObject = new ScriptObject(); |
|
|
|
var scriptObject = new ScriptObject(); |
|
|
|
@ -715,9 +715,9 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
{ |
|
|
|
{ |
|
|
|
ProgrammeStart = start, |
|
|
|
ProgrammeStart = start, |
|
|
|
ProgrammeStop = stop, |
|
|
|
ProgrammeStop = stop, |
|
|
|
ChannelNumber = request.ChannelNumber, |
|
|
|
request.ChannelNumber, |
|
|
|
HasCustomTitle = hasCustomTitle, |
|
|
|
HasCustomTitle = hasCustomTitle, |
|
|
|
CustomTitle = displayItem.CustomTitle, |
|
|
|
displayItem.CustomTitle, |
|
|
|
OtherVideoTitle = title, |
|
|
|
OtherVideoTitle = title, |
|
|
|
OtherVideoHasPlot = !string.IsNullOrWhiteSpace(metadata.Plot), |
|
|
|
OtherVideoHasPlot = !string.IsNullOrWhiteSpace(metadata.Plot), |
|
|
|
OtherVideoPlot = metadata.Plot, |
|
|
|
OtherVideoPlot = metadata.Plot, |
|
|
|
@ -863,10 +863,12 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
_ => 440 |
|
|
|
_ => 440 |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (artworkPath.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || artworkPath.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) |
|
|
|
if (artworkPath.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || |
|
|
|
|
|
|
|
artworkPath.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return artworkPath; |
|
|
|
return artworkPath; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (artworkPath.StartsWith("jellyfin://", StringComparison.OrdinalIgnoreCase)) |
|
|
|
if (artworkPath.StartsWith("jellyfin://", StringComparison.OrdinalIgnoreCase)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
artworkPath = JellyfinUrl.PlaceholderProxyForArtwork(artworkPath, artworkKind, height); |
|
|
|
artworkPath = JellyfinUrl.PlaceholderProxyForArtwork(artworkPath, artworkKind, height); |
|
|
|
@ -1077,7 +1079,8 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
var artwork = new List<Artwork>(); |
|
|
|
var artwork = new List<Artwork>(); |
|
|
|
if (!string.IsNullOrWhiteSpace(program.Icon)) |
|
|
|
if (!string.IsNullOrWhiteSpace(program.Icon)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
artwork.Add(new Artwork |
|
|
|
artwork.Add( |
|
|
|
|
|
|
|
new Artwork |
|
|
|
{ |
|
|
|
{ |
|
|
|
ArtworkKind = ArtworkKind.Thumbnail, |
|
|
|
ArtworkKind = ArtworkKind.Thumbnail, |
|
|
|
Path = program.Icon, |
|
|
|
Path = program.Icon, |
|
|
|
@ -1100,7 +1103,7 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
{ |
|
|
|
{ |
|
|
|
EpisodeNumber = program.Episode, |
|
|
|
EpisodeNumber = program.Episode, |
|
|
|
Title = program.Title |
|
|
|
Title = program.Title |
|
|
|
}, |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
Season = new Season |
|
|
|
Season = new Season |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -1125,7 +1128,8 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> |
|
|
|
var artwork = new List<Artwork>(); |
|
|
|
var artwork = new List<Artwork>(); |
|
|
|
if (!string.IsNullOrWhiteSpace(program.Icon)) |
|
|
|
if (!string.IsNullOrWhiteSpace(program.Icon)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
artwork.Add(new Artwork |
|
|
|
artwork.Add( |
|
|
|
|
|
|
|
new Artwork |
|
|
|
{ |
|
|
|
{ |
|
|
|
ArtworkKind = ArtworkKind.Poster, |
|
|
|
ArtworkKind = ArtworkKind.Poster, |
|
|
|
Path = program.Icon, |
|
|
|
Path = program.Icon, |
|
|
|
|