adds start_at

This commit is contained in:
Ollie Taylor
2023-02-25 16:33:43 +00:00
parent 1b12c92953
commit 4be36ba047
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -30,6 +30,7 @@ const episode_attributes = derived<
details: $details, details: $details,
will_autoplay: $audio.autoplay, will_autoplay: $audio.autoplay,
is_paused: $audio.paused, is_paused: $audio.paused,
start_at: podcast_progress.get_episode($audio.src)?.start_at ?? 0,
}); });
} }
+3 -2
View File
@@ -21,11 +21,12 @@ const stash_episode_progress = () => {
}; };
const get_episode_progress = (src: string): Pick<AudioLoadOptions, 'start_at'> | null => { const get_episode_progress = (src: string): Pick<AudioLoadOptions, 'start_at'> | null => {
const start_at = _episode_progress_map.get(src); const pathname = get_src_pathname(src);
const start_at = _episode_progress_map.get(pathname);
if (!start_at) return null; if (!start_at) return null;
info('found saved progress: ', src, start_at); info('found saved progress: ', pathname, start_at);
return { start_at: start_at }; return { start_at: start_at };
}; };