cache podcast images and use them on homepage

This commit is contained in:
2026-01-09 21:54:48 +01:00
parent d890c11a9b
commit f48aa86256
5 changed files with 264 additions and 2 deletions
@@ -189,7 +189,7 @@ public class JellypodChannel : IChannel, IHasCacheKey, IRequiresMediaInfoCallbac
Id = podcast.Id.ToString("N"),
Name = podcast.Title,
Overview = podcast.Description,
ImageUrl = podcast.ImageUrl,
ImageUrl = GetPodcastImageUrl(podcast.Id),
Type = ChannelItemType.Folder,
FolderType = ChannelFolderType.Container,
DateCreated = podcast.DateAdded,
@@ -257,7 +257,7 @@ public class JellypodChannel : IChannel, IHasCacheKey, IRequiresMediaInfoCallbac
Id = episode.Id.ToString("N"),
Name = episodeName,
Overview = overview,
ImageUrl = episode.ImageUrl ?? podcast.ImageUrl,
ImageUrl = GetEpisodeImageUrl(podcast.Id, episode.Id),
Type = ChannelItemType.Media,
ContentType = ChannelMediaContentType.Podcast,
MediaType = ChannelMediaType.Audio,
@@ -497,4 +497,16 @@ public class JellypodChannel : IChannel, IHasCacheKey, IRequiresMediaInfoCallbac
ReadAtNativeFramerate = false
};
}
private string GetPodcastImageUrl(Guid podcastId)
{
var localAddress = _appHost.GetApiUrlForLocalAccess();
return $"{localAddress}/Jellypod/Image/podcast/{podcastId:N}";
}
private string GetEpisodeImageUrl(Guid podcastId, Guid episodeId)
{
var localAddress = _appHost.GetApiUrlForLocalAccess();
return $"{localAddress}/Jellypod/Image/episode/{podcastId:N}/{episodeId:N}";
}
}