Refresh podcast counters when an episode changes status
Playing, completing or restarting an episode from the player updated its row but left the unplayed and in-progress counters of the podcast page as they were loaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
592d61dd58
commit
bf6981948a
1 file changed
+2
@@ -3675,6 +3675,8 @@ document.addEventListener('alpine:init', () => {
|
||||
// The player reported progress for an episode shown here.
|
||||
const episode = this.episodes.find(item => item.episode_id === episodeId);
|
||||
if (!episode || !data?.status) return;
|
||||
// Unplayed and in-progress counters of the page change with it.
|
||||
if (episode.status !== data.status) this.loadDetail();
|
||||
episode.status = data.status;
|
||||
episode.position_ms = Number(data.position_ms || 0);
|
||||
episode.resume_position_ms = data.status === 'in_progress' ? episode.position_ms : 0;
|
||||
|
||||
Reference in new issue
Block a user