diff --git a/common/components/cards/EpisodeCard.svelte b/common/components/cards/EpisodeCard.svelte index 4b8c544..2e6c9de 100644 --- a/common/components/cards/EpisodeCard.svelte +++ b/common/components/cards/EpisodeCard.svelte @@ -37,9 +37,9 @@ {media.duration}m {/if} - {#if progress && $progress > 0} -
-
+ {#if $progress > 0} +
+
{/if}
diff --git a/common/components/cards/EpisodePreviewCard.svelte b/common/components/cards/EpisodePreviewCard.svelte index 1821a03..ede9ca4 100644 --- a/common/components/cards/EpisodePreviewCard.svelte +++ b/common/components/cards/EpisodePreviewCard.svelte @@ -32,9 +32,9 @@ {media.duration}m {/if}
- {#if progress && $progress > 0} -
-
+ {#if $progress > 0} +
+
{/if}
diff --git a/common/components/cards/PreviewCard.svelte b/common/components/cards/PreviewCard.svelte index d504b59..7e3a16a 100644 --- a/common/components/cards/PreviewCard.svelte +++ b/common/components/cards/PreviewCard.svelte @@ -1,8 +1,7 @@
@@ -83,11 +80,6 @@ on:load={() => { hide = false }} src={`https://www.youtube-nocookie.com/embed/${media.trailer?.id}?autoplay=1&controls=0&mute=1&disablekb=1&loop=1&vq=medium&playlist=${media.trailer?.id}`} /> --> - {#if progress && $progress > 0} -
-
-
- {/if} {/if}
diff --git a/common/components/cards/SmallCard.svelte b/common/components/cards/SmallCard.svelte index d7a394b..8d6624e 100644 --- a/common/components/cards/SmallCard.svelte +++ b/common/components/cards/SmallCard.svelte @@ -1,10 +1,9 @@
@@ -39,11 +37,7 @@
{/if} cover - {#if progress && $progress > 0} -
-
-
- {/if} +
{#if media.mediaListEntry?.status}
diff --git a/common/views/Player/Player.svelte b/common/views/Player/Player.svelte index 3176b20..7c98754 100644 --- a/common/views/Player/Player.svelte +++ b/common/views/Player/Player.svelte @@ -201,23 +201,23 @@ } async function loadAnimeProgress () { - const mediaId = current?.media?.media?.id - const episode = current?.media?.episode - if (current?.media.failed || mediaId !== media?.media?.id || episode !== media?.episode) return - const animeProgress = await getAnimeProgress(mediaId, episode) + if (!current?.media?.media?.id || !current.media.media.episode || current.media.failed || !media?.media?.id || !media.episode) return + + const animeProgress = await getAnimeProgress(current.media.media.id, current.media.episode) if (!animeProgress) return + const currentTime = Math.max(animeProgress.currentTime - 5, 0) // Load 5 seconds before seek(currentTime - video.currentTime) } function saveAnimeProgress () { - const mediaId = current?.media?.media?.id - const episode = current?.media?.episode - if (current?.media?.failed || mediaId !== media?.media?.id || episode !== media?.episode) return + if (!current?.media?.media?.id || !current.media.media.episode || current.media.failed || !media?.media?.id || !media.episode) return + if (buffering || paused || video.readyState < 4) return - setAnimeProgress({ mediaId, episode, currentTime: video.currentTime, safeduration }) + + setAnimeProgress({ mediaId: current.media.media.id, episode: current.media.episode, currentTime: video.currentTime, safeduration }) } - setInterval(saveAnimeProgress, 1000) + setInterval(saveAnimeProgress, 30000) function cycleSubtitles () { if (current && subs?.headers) {