Deduplicate media across scrapes and polish the viewer controls
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user