2012-06-17, 05:51
(2012-06-17, 03:25)Angelscry Wrote:(2012-06-16, 23:59)goldsac Wrote: I like the way it sorts items, ignoring articles "the" and "a". Is there anywhere in the code that we could modify this to add to the list of ignored words?Articles are moved (or not) at the end by the title_format function (lines 2412 to 2426 from launcher_plugin.py file)
(2012-06-16, 23:59)goldsac Wrote: This has come up with SNES games. There are too many games that are prefixed with the word "super". I like to keep the prefix in the title but have, for example, Super Castlevania IV show up in the C section.Code:def title_format(self,title):
if ( self.settings[ "clean_title" ] ):
title = re.sub('\[.*?\]', '', title)
title = re.sub('\(.*?\)', '', title)
title = re.sub('\{.*?\}', '', title)
new_title = title.rstrip()
if ( self.settings[ "title_formating" ] ):
if (title.startswith("The ")): new_title = title.replace("The ","",1)+", The"
if (title.startswith("A ")): new_title = title.replace("A ","",1)+", A"
if (title.startswith("An ")): new_title = title.replace("An ","",1)+", An"
if (title.startswith("Super ")): new_title = title.replace("Super ","",1)+", Super"
else:
if (title.endswith(", The")): new_title = "The "+"".join(title.rsplit(", The",1))
if (title.endswith(", A")): new_title = "A "+"".join(title.rsplit(", A",1))
if (title.endswith(", An")): new_title = "An "+"".join(title.rsplit(", An",1))
if (title.endswith(", Super")): new_title = "Super "+"".join(title.rsplit(", Super",1))
return new_title
It may do the job (but not tested).
Thanks for checking, appreciate it.
I gave that a shot, but unfortunately it just produces a script error upon launch of the add-on when implemented.