Add video poster frames and rework the media status row

This commit is contained in:
Fisto
2026-09-16 12:40:10 +02:00
parent f9b4041157
commit 043d1cd3c5
9 changed files with 124 additions and 12 deletions
+9
View File
@@ -10,6 +10,7 @@ import {
downloadOne,
downloadPreview,
probeDimensions,
videoPoster,
type DownloadOptions
} from "./download.js";
import {
@@ -324,6 +325,14 @@ export class ScrapeEngine {
);
if (dimensions) store.updateDimensions(row.id, dimensions.width, dimensions.height);
}
if (row.kind === "video" && !row.preview_hash) {
const poster = await videoPoster(join(targetDir, outcome.path), join(dir, "thumbs"));
if (poster) {
store.markPreview(row.id, poster);
meta.previewed = (meta.previewed ?? 0) + 1;
}
}
} else {
store.markDownloadError(row.id, outcome.error ?? outcome.state);
if (outcome.state === "failed") meta.downloadErrors = (meta.downloadErrors ?? 0) + 1;