Cache preview frames for Discord video attachments

This commit is contained in:
Fisto
2026-09-16 23:40:46 +02:00
parent 3da0da0ca7
commit caf9b7db3a
6 changed files with 34 additions and 13 deletions
+2 -1
View File
@@ -342,7 +342,8 @@ export class ScrapeStore {
* embed thumbnails only when `includeEmbeds` is set (download mode).
*/
pendingPreviews(limit = 5000, includeEmbeds = false): MediaRow[] {
const local = "(kind IN ('image', 'gif') AND (source IS NULL OR source != 'embed'))";
const local =
"((source IS NULL OR source != 'embed') AND kind IN ('image', 'gif', 'video'))";
const condition = includeEmbeds
? `(${local} OR (source = 'embed' AND preview_url IS NOT NULL))`
: local;