summaryrefslogtreecommitdiff
path: root/libmat2/audio.py
diff options
context:
space:
mode:
authorjvoisin2018-10-11 18:15:11 +0200
committerjvoisin2018-10-11 18:15:11 +0200
commitb2e153b69caac208fb1821e2f21436a2f0487188 (patch)
treef728430629835f0a7fb2b7c3538df8da42494453 /libmat2/audio.py
parent35dca4bf1cb4d47ea39b844db599eccfe40288bb (diff)
Delete pictures of FLAC files
Diffstat (limited to 'libmat2/audio.py')
-rw-r--r--libmat2/audio.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/libmat2/audio.py b/libmat2/audio.py
index 99a335d..f2a5e94 100644
--- a/libmat2/audio.py
+++ b/libmat2/audio.py
@@ -44,3 +44,17 @@ class OGGParser(MutagenParser):
44 44
45class FLACParser(MutagenParser): 45class FLACParser(MutagenParser):
46 mimetypes = {'audio/flac', 'audio/x-flac'} 46 mimetypes = {'audio/flac', 'audio/x-flac'}
47
48 def remove_all(self):
49 shutil.copy(self.filename, self.output_filename)
50 f = mutagen.File(self.output_filename)
51 f.clear_pictures()
52 f.delete()
53 f.save(deleteid3=True)
54 return True
55
56 def get_meta(self):
57 meta = super().get_meta()
58 if mutagen.File(self.filename).pictures:
59 meta['Picture'] = 'Cover'
60 return meta