Add progress and complettion indication
This commit is contained in:
@@ -236,13 +236,27 @@ public class JellypodChannel : IChannel, IHasCacheKey, IRequiresMediaInfoCallbac
|
||||
|
||||
foreach (var episode in episodes)
|
||||
{
|
||||
// Build episode name with played indicator
|
||||
var episodeName = episode.IsPlayed
|
||||
? $"[Played] {episode.Title}"
|
||||
: episode.Title;
|
||||
|
||||
// Build overview with progress info if partially played
|
||||
var overview = episode.Description ?? string.Empty;
|
||||
if (episode.PlaybackPositionTicks > 0 && !episode.IsPlayed && episode.Duration.HasValue)
|
||||
{
|
||||
var progressPercent = (int)((double)episode.PlaybackPositionTicks / episode.Duration.Value.Ticks * 100);
|
||||
var positionTime = TimeSpan.FromTicks(episode.PlaybackPositionTicks);
|
||||
overview = $"[{progressPercent}% - {positionTime:hh\\:mm\\:ss}] {overview}";
|
||||
}
|
||||
|
||||
// Don't provide MediaSources here - this forces Jellyfin to call GetChannelItemMediaInfo
|
||||
// which allows us to download-on-demand and return proper local file paths
|
||||
items.Add(new ChannelItemInfo
|
||||
{
|
||||
Id = episode.Id.ToString("N"),
|
||||
Name = episode.Title,
|
||||
Overview = episode.Description,
|
||||
Name = episodeName,
|
||||
Overview = overview,
|
||||
ImageUrl = episode.ImageUrl ?? podcast.ImageUrl,
|
||||
Type = ChannelItemType.Media,
|
||||
ContentType = ChannelMediaContentType.Podcast,
|
||||
|
||||
Reference in New Issue
Block a user