Skip to content

Commit cec56bc

Browse files
authored
Merge pull request #147 from sayanarijit/fix-146
Try matching audio before video
2 parents bbae93d + 1f664b6 commit cec56bc

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

filetype/types/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@
115115

116116

117117
# Expose supported type matchers
118-
TYPES = list(VIDEO + IMAGE + AUDIO + FONT + DOCUMENT + ARCHIVE + APPLICATION)
118+
TYPES = list(IMAGE + AUDIO + VIDEO + FONT + DOCUMENT + ARCHIVE + APPLICATION)

tests/fixtures/sample.m4a

76.7 KB
Binary file not shown.

tests/test_types.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ def test_guess_avif(self):
5050
self.assertEqual(kind.mime, 'image/avif')
5151
self.assertEqual(kind.extension, 'avif')
5252

53+
def test_guess_m4a(self):
54+
kind = filetype.guess(FIXTURES + '/sample.m4a')
55+
self.assertTrue(kind is not None)
56+
self.assertEqual(kind.mime, 'audio/mp4')
57+
self.assertEqual(kind.extension, 'm4a')
58+
59+
5360
def test_guess_mp4(self):
5461
kind = filetype.guess(FIXTURES + '/sample.mp4')
5562
self.assertTrue(kind is not None)

0 commit comments

Comments
 (0)