diff --git a/man/whipper-cd-rip.rst b/man/whipper-cd-rip.rst index 1b7ec56..4f1e57e 100644 --- a/man/whipper-cd-rip.rst +++ b/man/whipper-cd-rip.rst @@ -96,6 +96,7 @@ Template schemes | - %S: release sort name | - %B: release barcode | - %C: release catalog number +| - %c: release disambiguation comment | - %d: release title (with disambiguation) | - %D: disc title (without disambiguation) | - %I: MusicBrainz Disc ID diff --git a/whipper/command/cd.py b/whipper/command/cd.py index a36386e..a3e3b37 100644 --- a/whipper/command/cd.py +++ b/whipper/command/cd.py @@ -56,6 +56,7 @@ disc and track template are: - %S: release sort name - %B: release barcode - %C: release catalog number + - %c: release disambiguation comment - %d: release title (with disambiguation) - %D: disc title (without disambiguation) - %I: MusicBrainz Disc ID diff --git a/whipper/common/common.py b/whipper/common/common.py index da41250..76f1155 100644 --- a/whipper/common/common.py +++ b/whipper/common/common.py @@ -277,9 +277,9 @@ def getRelativePath(targetPath, collectionPath): def validate_template(template, kind): """Raise exception if disc/track template includes invalid variables.""" if kind == 'disc': - matches = re.findall(r'%[^ABCDIRSXdrxy]', template) + matches = re.findall(r'%[^ABCDIRSXcdrxy]', template) elif kind == 'track': - matches = re.findall(r'%[^ABCDIRSXadnrstxy]', template) + matches = re.findall(r'%[^ABCDIRSXacdnrstxy]', template) if '%' in template and matches: raise ValueError(kind + ' template string contains invalid ' 'variable(s): {}'.format(', '.join(matches))) diff --git a/whipper/common/mbngs.py b/whipper/common/mbngs.py index 850b15a..b785ea3 100644 --- a/whipper/common/mbngs.py +++ b/whipper/common/mbngs.py @@ -70,6 +70,8 @@ class DiscMetadata: :vartype title: str or None :cvar releaseTitle: title of the release (with disambiguation) :vartype releasetitle: str or None + :cvar releaseDisambCmt: release disambiguation comment + :vartype releaseDisambCmt: str or None :vartype tracks: list of :any:`TrackMetadata` :cvar countries: MusicBrainz release countries :vartype countries: list or None @@ -87,6 +89,7 @@ class DiscMetadata: release = None releaseTitle = None + releaseDisambCmt = None releaseType = None mbid = None @@ -290,6 +293,7 @@ def _getMetadata(release, discid=None, country=None): discMD.title = release['title'] discMD.releaseTitle = releaseTitle = discMD.title if 'disambiguation' in release: + discMD.releaseDisambCmt = release['disambiguation'] releaseTitle += " (%s)" % release['disambiguation'] count = len(release['medium-list']) if count > 1: diff --git a/whipper/common/program.py b/whipper/common/program.py index 75b5732..4f3ec44 100644 --- a/whipper/common/program.py +++ b/whipper/common/program.py @@ -178,6 +178,7 @@ class Program: * ``%S``: release artist sort name * ``%B``: release barcode * ``%C``: release catalog number + * ``%c``: release disambiguation comment * ``%d``: release title (with disambiguation) * ``%D``: disc title (without disambiguation) * ``%I``: MusicBrainz Disc ID @@ -216,6 +217,7 @@ class Program: v['D'] = metadata.title v['B'] = metadata.barcode v['C'] = metadata.catalogNumber + v['c'] = metadata.releaseDisambCmt if metadata.releaseType: v['R'] = metadata.releaseType v['r'] = metadata.releaseType.lower()