feat: use saved progress for watch button on anime page

Check continue_watching_entry to find the episode to resume from.
Show 'Continue Episode N' instead of 'Watch Now' when progress exists.
This commit is contained in:
2026-05-13 18:16:25 +02:00
parent 851c9d701f
commit 413ee70923
3 changed files with 18 additions and 7 deletions

View File

@@ -85,7 +85,7 @@
{{if $anime.ShortRating}}<span class="flex items-center gap-1.5"><span>•</span>{{$anime.ShortRating}}</span>{{end}}
</div>
{{template "watchlist_actions" dict "Anime" $anime "User" .User "Status" .Status}}
{{template "watchlist_actions" dict "Anime" $anime "User" .User "Status" .Status "ContinueWatchingEp" .ContinueWatchingEp "ContinueWatchingTime" .ContinueWatchingTime}}
<div class="flex flex-col gap-12 lg:flex-row">
<div class="grow lg:max-w-4xl">

View File

@@ -46,9 +46,8 @@
</div>
</ui-dropdown>
<a href="/anime/{{$anime.MalID}}/watch" class="bg-background-button hover:bg-background-button-hover px-5 py-2.5 text-sm font-medium text-foreground transition-colors">
<i class="fa-solid fa-play mr-2"></i>
Watch Now
<a href="/anime/{{$anime.MalID}}/watch{{if and .ContinueWatchingEp (ne .ContinueWatchingEp 1)}}?ep={{.ContinueWatchingEp}}{{end}}" class="bg-background-button hover:bg-background-button-hover px-5 py-2.5 text-sm font-medium text-foreground transition-colors">
{{if and .ContinueWatchingEp (ne .ContinueWatchingEp 1)}}Continue Episode {{.ContinueWatchingEp}}{{else}}Watch Now{{end}}
</a>
</div>