Commit b2e153b6 authored by jvoisin's avatar jvoisin

Delete pictures of FLAC files

parent 35dca4bf
Pipeline #19556 failed with stages
in 4 minutes and 36 seconds
......@@ -44,3 +44,17 @@ class OGGParser(MutagenParser):
class FLACParser(MutagenParser):
mimetypes = {'audio/flac', 'audio/x-flac'}
def remove_all(self):
shutil.copy(self.filename, self.output_filename)
f = mutagen.File(self.output_filename)
return True
def get_meta(self):
meta = super().get_meta()
if mutagen.File(self.filename).pictures:
meta['Picture'] = 'Cover'
return meta
No preview for this file type
......@@ -96,6 +96,7 @@ class TestGetMeta(unittest.TestCase):
p = audio.FLACParser('./tests/data/dirty.flac')
meta = p.get_meta()
self.assertEqual(meta['title'], 'I am so')
self.assertEqual(meta['Picture'], 'Cover')
def test_docx(self):
p = office.MSOfficeParser('./tests/data/dirty.docx')
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment