From f391c9603c36a8ec80942c23ac6ba39fca5df72a Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 31 Mar 2018 15:46:17 +0200 Subject: Change a bit the source code organisation --- src/parsers/audio.py | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 src/parsers/audio.py (limited to 'src/parsers/audio.py') diff --git a/src/parsers/audio.py b/src/parsers/audio.py deleted file mode 100644 index 4da298c..0000000 --- a/src/parsers/audio.py +++ /dev/null @@ -1,37 +0,0 @@ -import subprocess -import shutil -import json - -import mutagen - -from . import abstract - -class MutagenParser(abstract.AbstractParser): - def get_meta(self): - f = mutagen.File(self.filename) - if f.tags: - return f.tags - return {} - - def remove_all(self): - shutil.copy(self.filename, self.output_filename) - f = mutagen.File(self.output_filename) - f.delete() - f.save() - return True - -class MP3Parser(MutagenParser): - mimetypes = {'audio/mpeg', } - - def get_meta(self): - meta = super().get_meta() - metadata = {} - for key in meta: - metadata[key] = meta[key].text - return metadata - -class OGGParser(MutagenParser): - mimetypes = {'audio/ogg', } - -class FLACParser(MutagenParser): - mimetypes = {'audio/flac', } -- cgit v1.3