From b2e153b69caac208fb1821e2f21436a2f0487188 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 11 Oct 2018 18:15:11 +0200 Subject: Delete pictures of FLAC files --- libmat2/audio.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libmat2/audio.py') 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): 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) + f.clear_pictures() + f.delete() + f.save(deleteid3=True) + return True + + def get_meta(self): + meta = super().get_meta() + if mutagen.File(self.filename).pictures: + meta['Picture'] = 'Cover' + return meta -- cgit v1.3