fix(media): classify mp4-formatted gif previews as video

This commit is contained in:
Tommaso Casaburi
2026-05-02 23:42:20 +07:00
parent ab6dce563a
commit 36bb1f726d
2 changed files with 13 additions and 7 deletions
@@ -128,6 +128,7 @@ describe('media-utils', () => {
url: 'https://ibb.co/abc123',
});
expect(getLinkMediaInfo('https://example.com/file.gif')).toMatchObject({ type: 'gif' });
expect(getLinkMediaInfo('https://external-preview.redd.it/example.gif?width=480&format=mp4')).toMatchObject({ type: 'video' });
expect(getLinkMediaInfo('https://example.com/file.png')).toMatchObject({ type: 'image' });
expect(getLinkMediaInfo('https://example.com/file.mp4')).toMatchObject({ type: 'video' });
expect(getLinkMediaInfo('https://example.com/file.mp3')).toMatchObject({ type: 'audio' });