Merge lp:~themineo/picard/wvc into lp:~musicbrainz-developers/picard/trunk

Proposed by Wieland Hoffmann
Status: Merged
Merged at revision: 1165
Proposed branch: lp:~themineo/picard/wvc
Merge into: lp:~musicbrainz-developers/picard/trunk
Diff against target: 26 lines (+9/-0)
1 file modified
picard/formats/ (+9/-0)
To merge this branch: bzr merge lp:~themineo/picard/wvc
Reviewer Review Type Date Requested Status
Lukáš Lalinský Approve
Review via email:

Description of the change

WavPack files can have a correction file (.wvc) in hybrid mode that allows lossless decoding. These files need to be moved, too, if a wavpack file is moved.

To post a comment you must log in.
Revision history for this message
Lukáš Lalinský (luks) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'picard/formats/'
2--- picard/formats/ 2011-04-11 17:58:33 +0000
3+++ picard/formats/ 2011-07-24 19:32:32 +0000
4@@ -26,6 +26,7 @@
5 from picard.file import File
6 from picard.metadata import Metadata
7 from picard.util import encode_filename, sanitize_date, mimetype
8+from os.path import isfile
10 class APEv2File(File):
11 """Generic APEv2-based file."""
12@@ -166,6 +167,14 @@
13 super(WavPackFile, self)._info(metadata, file)
14 metadata['~format'] = self.NAME
16+ def _save_and_rename(self, old_filename, metadata, settings):
17+ """Includes an additional check for WavPack correction files"""
18+ wvc_filename = old_filename.replace(".wv", ".wvc")
19+ if isfile(wvc_filename):
20+ if settings["rename_files"] or settings["move_files"]:
21+ self._rename(wvc_filename, metadata, settings)
22+ File._save_and_rename(self, old_filename, metadata, settings)
24 class OptimFROGFile(APEv2File):
25 """OptimFROG file."""
26 EXTENSIONS = [".ofr", ".ofs"]


People subscribed via source and target branches

to status/vote changes: