Skip to content
Snippets Groups Projects
Commit 2eb68928 authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

FLAC support

parent 19a8fd97
No related branches found
No related tags found
No related merge requests found
......@@ -33,3 +33,6 @@ class MP3Parser(MutagenParser):
class OGGParser(MutagenParser):
mimetypes = {'audio/ogg', }
class FLACParser(MutagenParser):
mimetypes = {'audio/flac', }
File added
......@@ -35,6 +35,11 @@ class TestGetMeta(unittest.TestCase):
meta = p.get_meta()
self.assertEqual(meta['TITLE'], ['I am so'])
def test_flac(self):
p = audio.FLACParser('./tests/data/dirty.flac')
meta = p.get_meta()
self.assertEqual(meta['TITLE'], ['I am so'])
class TestCleaning(unittest.TestCase):
def test_pdf(self):
......@@ -112,3 +117,18 @@ class TestCleaning(unittest.TestCase):
self.assertEqual(p.get_meta(), {})
os.remove('./tests/data/clean.ogg')
def test_flac(self):
shutil.copy('./tests/data/dirty.flac', './tests/data/clean.flac')
p = audio.FLACParser('./tests/data/clean.flac')
meta = p.get_meta()
self.assertEqual(meta['TITLE'], ['I am so'])
ret = p.remove_all()
self.assertTrue(ret)
p = audio.FLACParser('./tests/data/clean.flac.cleaned')
self.assertEqual(p.get_meta(), {})
os.remove('./tests/data/clean.flac')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment