diff options
| author | jvoisin | 2018-10-11 18:15:11 +0200 |
|---|---|---|
| committer | jvoisin | 2018-10-11 18:15:11 +0200 |
| commit | b2e153b69caac208fb1821e2f21436a2f0487188 (patch) | |
| tree | f728430629835f0a7fb2b7c3538df8da42494453 /libmat2/audio.py | |
| parent | 35dca4bf1cb4d47ea39b844db599eccfe40288bb (diff) | |
Delete pictures of FLAC files
Diffstat (limited to 'libmat2/audio.py')
| -rw-r--r-- | libmat2/audio.py | 14 |
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 | ||
| 45 | class FLACParser(MutagenParser): | 45 | class 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 | ||
