Kodi Community Forum

Full Version: sort ignoring tokens (articles) doesnt work for me
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
is there a smart way to sort things ignoring articles (a, an, the). basically i would want:
Code:
smokin-aces.avi
so-close.avi
spy-game.avi
street-fighter-alpha-2001.avi
talladaga-nights.avi
[b]the-departed.avi[/b]
[b]the-happening.avi[/b]
transformers.avi
vantage-point.avi
to sort like:
Code:
[b]the-departed.avi[/b]
[b]the-happening.avi[/b]
smokin-aces.avi
so-close.avi
spy-game.avi
street-fighter-alpha-2001.avi
talladaga-nights.avi
transformers.avi
vantage-point.avi
the 'sort ignoring tokens' setting doesnt work for me; any suggestions,
thanks,
You need to sort by NAME not by FILE for ignore tokens to work outside the library.
still no joy even with sort by name.

how do i name files by there filenames ?
What?
i was wondering if there is something i could use to name media files so they sort the way i'd like.
It's the dash. Use a space or underscore instead. If you use and underscore, you'll have to enable "clean file and directory names" in video settings. Dunno what platform you're on, but there are hordes of file renaming apps on all of them.
thanks al, i'll look into it.

i think i got the same behaviour in my files with spaces in them but i didnt do "clean file and directory names" - wasnt sure what it did.

i'm using the live-usb (i dont like spaces in filenames because it leads to having to slap quotes around everything in linux)
Ah, you can do some bash to rename your files then. We do a case insensitive search at the beginning of the item label for the tokens defined in language/[your language]/langinfo.xml with a space appended. I believe you can use ' ', '_' or '.' and the clean filenames options will replace them with spaces so the sort tokens will work.
once again thanks al, i'm at work so i'll have to see if i can bash it out once i get home.

also this thread is kinda' related; i opened it yesterday in the suggestions forum:
http://www.xbmc.org/forum/showthread.php?t=53759 (do you have any thoughts ?)
update: it sorts correctly with ignoring 'the' but not 'a':

i edited langinfo.xml to have:
Code:
<sorttokens>
    <token>the</token>
[b]    <token>a</token>
    <token>an</token>
[/b]  </sorttokens>
but it lists things like:
Code:
a q.avi
the b.avi
m.avi
i expect q to come after m.

also, i wish that i didnt have to rename hundreds of files because the 'ignore the' feature doesnt work with a hyphen as a word delimitter.