Add video poster frames and rework the media status row
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user