cache podcast images and use them on homepage
This commit is contained in:
@@ -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}";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user