refactor: group episode state

This commit is contained in:
2026-06-16 10:38:16 +02:00
committed by Milas Holsting
parent 7aaead6c67
commit ff54e9c5db
6 changed files with 143 additions and 133 deletions

View File

@@ -5,10 +5,10 @@ import { state } from "../state";
* Injects images into episode cards, replaces placeholder.
*/
export const setupThumbnails = (): void => {
const episodeList = state.episodeList;
const episodeList = state.elements.episodeList;
if (!episodeList) return;
fetch(`/api/watch/thumbnails/${state.malID}`)
fetch(`/api/watch/thumbnails/${state.episode.malID}`)
.then((res) => res.json())
.then((data: { mal_id: number; url: string; title?: string }[]) => {
data.forEach((item) => {