feat: add deep fallback for latest anime episodes
This commit is contained in:
@@ -15,6 +15,12 @@
|
||||
<p class="text-lg">No episodes found for this anime.</p>
|
||||
</div>
|
||||
{{else}}
|
||||
{{$totalEps := $anime.Episodes}}
|
||||
{{$fallbackSub := .WatchData.FallbackEpisodes.sub}}
|
||||
{{if gt $fallbackSub $totalEps}}
|
||||
{{$totalEps = $fallbackSub}}
|
||||
{{end}}
|
||||
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
|
||||
{{range $episodes}}
|
||||
{{$isCurrent := eq (printf "%v" .MalID) $currentEpID}}
|
||||
@@ -27,6 +33,11 @@
|
||||
<svg class="h-8 w-8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/></svg>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if gt .MalID $anime.Episodes}}
|
||||
<div class="absolute left-2 top-2 rounded bg-red-600 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-white shadow-sm">
|
||||
Latest
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="absolute inset-0 flex items-center justify-center bg-black/40 opacity-0 transition-opacity group-hover:opacity-100">
|
||||
<div class="bg-accent flex h-12 w-12 items-center justify-center rounded-full text-white shadow-lg">
|
||||
<svg class="ml-1 h-6 w-6" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z" /></svg>
|
||||
|
||||
Reference in New Issue
Block a user