Only split move_prefix if there is a space after

Fixes issues where a move_prefix of "A" turns
"Avengers" into "vengers, A"

Also fixes issue where the sort_title includes a preceding space
"The Fast and the Furious"->" Fast and the Furious, The"
pull/907/head
AevumDecessus 3 years ago committed by meisnate12
parent 01cea9114e
commit 062394c6d3

@ -184,8 +184,8 @@ class DataFile:
prefix = template["move_collection_prefix"]
if prefix:
for op in util.get_list(prefix):
if variables[name_var].startswith(op):
sort_name = f"{variables[name_var][len(op):]}, {op}"
if variables[name_var].startswith(f"{op} "):
sort_name = f"{variables[name_var][len(op):].lstrip()}, {op}"
break
else:
raise Failed(f"{self.data_type} Error: template sub-attribute move_prefix is blank")

Loading…
Cancel
Save