From b2f77f3300f63ec1e0c5bf3acfe91105804ccfea Mon Sep 17 00:00:00 2001 From: Christian Bager Bach Houmann Date: Mon, 24 Nov 2025 07:25:25 +0100 Subject: [PATCH] Remove redundant currentTime sync --- src/ui/PodcastView/EpisodePlayer.svelte | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/ui/PodcastView/EpisodePlayer.svelte b/src/ui/PodcastView/EpisodePlayer.svelte index 82432b7..7889be7 100644 --- a/src/ui/PodcastView/EpisodePlayer.svelte +++ b/src/ui/PodcastView/EpisodePlayer.svelte @@ -114,16 +114,7 @@ let srcPromise: Promise = getSrc($currentEpisode); - // #region Keep player time and currentTime in sync - // Simply binding currentTime to the audio element will result in resets. - // Hence the following solution. - let playerTime: number = 0; - onMount(() => { - const unsub = currentTime.subscribe((ct) => { - playerTime = ct; - }); - // This only happens when the player is open and the user downloads the episode via the context menu. // So we want to update the source of the audio element to local file / online stream. const unsubDownloadedSource = downloadedEpisodes.subscribe(_ => { @@ -139,18 +130,12 @@ }); return () => { - unsub(); unsubDownloadedSource(); unsubCurrentEpisode(); unsubVolume(); }; }); - $: { - currentTime.set(playerTime); - } - // #endregion - onDestroy(() => { playedEpisodes.setEpisodeTime($currentEpisode, $currentTime, $duration, ($currentTime === $duration)); isPaused.set(true); @@ -234,7 +219,7 @@