diff options
| author | mikeos <mike.osipov@gmail.com> | 2013-09-30 04:04:18 +0400 |
|---|---|---|
| committer | mikeos <mike.osipov@gmail.com> | 2013-09-30 04:04:18 +0400 |
| commit | 5fb3e2f167ba4a742dc84ed58ddd68c8374a1195 (patch) | |
| tree | fe3e5a524d1334c22ee47111076928acff5fc887 | |
| parent | 4f343a86a7d3294d654494578fc5e717f868de3a (diff) | |
formats: make tag method optional
| -rwxr-xr-x | cutter | 4 | ||||
| -rw-r--r-- | formats/__base__.py | 3 | ||||
| -rw-r--r-- | formats/wav.py | 4 |
3 files changed, 7 insertions, 4 deletions
@@ -351,6 +351,7 @@ class CueSplitter: self.tracktotal = len(list(self.all_tracks())) self.enctype = formats.handler(opt.type, logger=printf) + self.tag_supported = self.enctype.is_tag_supported() self.tags = { "album": self.opt.album or self.cue.get("title"), @@ -448,6 +449,9 @@ class CueSplitter: return self.track_info[track].tags def tag(self, track, path): + if not self.tag_supported: + return + printf("Tag [%s] : ", path) if not self.enctype.tag(path, self.track_tags(track)): printf("FAILED\n") diff --git a/formats/__base__.py b/formats/__base__.py index 4bb6598..f17748a 100644 --- a/formats/__base__.py +++ b/formats/__base__.py @@ -23,3 +23,6 @@ class BaseHandler: self.add("-b %d" % opt.bits_per_sample) if opt.channels and opt.channels != info.channels: self.add("-c %d" % opt.channels) + + def is_tag_supported(self): + return hasattr(self, "tag") diff --git a/formats/wav.py b/formats/wav.py index 76c2ed3..66169fc 100644 --- a/formats/wav.py +++ b/formats/wav.py @@ -11,9 +11,5 @@ class WavHandler(BaseHandler): return self.build() - def tag(self, *args): - self.log("SKIP ") - return True - def init(): return WavHandler |
