2012-06-03, 22:39
(2012-06-03, 20:47)Angelscry Wrote:(2012-06-03, 10:21)bzim Wrote: Hey Angelscry,Except for disc numbers (for multi-disc games), that's not actually the case?
What are your thoughts on having %rombasename% filter info between brackets [], even if not part of a multi-disc selection? To me, it feels more consistent to have it filter regardless of whether it is single or multi-disc.
No. Currently the base_filename method looks like this:
Code:
def base_filename(filename):
basefilename = filename
ext3s = ['.cd1', '-cd1', '_cd1', ' cd1']
for ext3 in ext3s:
if ( filename.lower().find(ext3) > -1 ):
basefilename = clean_filename(filename.replace(ext3, ""))
return basefilename
So, if Castlevania - Symphony of the Night [SLUS-00067] gets passed in, nothing changes (because it doesn't have a .cd# extension).
I propose the change below:
Code:
def base_filename(filename):
filename = re.sub('(\[.*?\]|\(.*?\))', '', filename)
filename = re.sub('(\.|-| |_)cd\d+$', '', filename)
return filename.rstrip()
Using the proposed change, if we passed Castlevania - Symphony of the Night [SLUS-00067], we would be returned with Castlevania - Symphony of the Night, which seems more consistent to me.
Also, using clean_filename in the current method is causing some side affects. For example, passing in:
Oddworld - Abe's Exoddus [SLUS-00710].cd1 would return Oddworld Abe's Exoddus (missing the dash, with three spaces between Oddworld and Abe's).