Always disambiguate in the release title part of the template

Fixes https://github.com/JoeLametta/whipper/issues/127
This commit is contained in:
Frederik “Freso” S. Olesen
2017-04-29 13:54:43 +02:00
parent 846ee04a5f
commit 3f30f1d46f

View File

@@ -243,10 +243,13 @@ class Program:
# when disambiguating, use catalogNumber then barcode
if disambiguate:
templateParts = list(os.path.split(template))
if self.metadata.catalogNumber:
templateParts[-2] += ' (%s)' % self.metadata.catalogNumber
elif self.metadata.barcode:
templateParts[-2] += ' (%s)' % self.metadata.barcode
# Find the section of the template with the release name
for i, part in enumerate(templateParts):
if "%d" in part:
if self.metadata.catalogNumber:
templateParts[i] += ' (%s)' % self.metadata.catalogNumber
elif self.metadata.barcode:
templateParts[i] += ' (%s)' % self.metadata.barcode
template = os.path.join(*templateParts)
logger.debug('Disambiguated template to %r' % template)