Use regular str.split() to split template parts in disambiguation

os.path.split() only even splits into two components, which means that
path templates that have more than two parts (e.g., `%A/%d - %y/%X`)
will not get split properly for the purpose of added disambiguation
parts to them.

os.path.join() will still work fine to splice the split template back
together as it takes an arbitrary number of arguments.
This commit is contained in:
Frederik “Freso” S. Olesen
2017-04-29 14:25:17 +02:00
parent 12e52da55d
commit a14989583e

View File

@@ -242,7 +242,7 @@ class Program:
# when disambiguating, use catalogNumber then barcode
if disambiguate:
templateParts = list(os.path.split(template))
templateParts = template.split(os.sep)
# Find the section of the template with the release name
for i, part in enumerate(templateParts):
if "%d" in part: