wip: Add image downloading

This commit is contained in:
2025-03-15 22:24:25 +01:00
parent 82d8a00eb4
commit 1a11bc3492
12 changed files with 123 additions and 40 deletions

View File

@@ -8,7 +8,7 @@ import {
} from "~/db/schema";
import { conflictUpdateAllExcept, sqlarr, values } from "~/db/utils";
import type { SeedEntry as SEntry, SeedExtra as SExtra } from "~/models/entry";
import { processOptImage } from "../images";
import { enqueueOptImage } from "../images";
import { guessNextRefresh } from "../refresh";
import { updateAvailableCount } from "./shows";
@@ -55,7 +55,7 @@ export const insertEntries = async (
...entry,
showPk: show.pk,
slug: generateSlug(show.slug, seed),
thumbnail: processOptImage(seed.thumbnail),
thumbnail: enqueueOptImage(seed.thumbnail),
nextRefresh:
entry.kind !== "extra"
? guessNextRefresh(entry.airDate ?? new Date())
@@ -103,7 +103,7 @@ export const insertEntries = async (
...tr,
poster:
seed.kind === "movie"
? processOptImage((tr as any).poster)
? enqueueOptImage((tr as any).poster)
: undefined,
}));
});