Deduplicate media across scrapes and polish the viewer controls

This commit is contained in:
Fisto
2026-09-16 13:05:31 +02:00
parent 1b5fcfed2f
commit d3f9d20190
12 changed files with 198 additions and 85 deletions
+5 -1
View File
@@ -151,7 +151,11 @@ function extractFrom(message: MediaMessage): ExtractedMedia[] {
size: attachment.size,
width: attachment.width,
height: attachment.height,
durationSecs: attachment.durationSecs,
// Discord sends 0 for non-audio attachments; treat it as unknown.
durationSecs:
Number.isFinite(attachment.durationSecs) && (attachment.durationSecs as number) > 0
? attachment.durationSecs
: null,
downloaded: false,
previewUrl: null
});