Skipping "The" in sorting game titles in EmulationStation?
-
Well personally I've always wished Final Fantasy IX was listed after Final Fantasy VII in my list. Now I can set the "sortnames" to "Final Fantasy 9" and "Final Fantasy 7" but keep the display names with Roman numerals.
-
@joemommasfat
I see, good. I like that your PR is nicely conservative in the sense that you only need to set a sort-name if you need to, as it falls back nicely on the regular game name.To build on that, I think we will need some additional work if we want to support sorting of game franchise series, especially across platforms (tag @pjft). Maybe a combination of sort by name and date, or based on another new metadata entry called "series" or "franchise"?
-
@joemommasfat said in Skipping "The" in sorting game titles in EmulationStation?:
If you want to use this, change line 139 of
~/RetroPie-Setup/scriptmodules/supplementary/emulationstation.sh
Maybe using
es-tests.sh
can be simpler and avoid confusion. I posted about it here: https://retropie.org.uk/forum/topic/10626/es-devs-and-testers-this-tool-is-for-you -
@joemommasfat said in Skipping "The" in sorting game titles in EmulationStation?:
Well personally I've always wished Final Fantasy IX was listed after Final Fantasy VII in my list. Now I can set the "sortnames" to "Final Fantasy 9" and "Final Fantasy 7" but keep the display names with Roman numerals.
That's a good solution you came up with there. Is there a way to automate this by comparing roman numerals to exact titles that also have them? That way you wouldn't have to go in and manually edit the gamelist.xml to make it happen.
We've been able to do that on the XBox for quite some time, actually. I'm going to talk to the dev and see what he did to make it work. I know it's automatic there. Maybe that would give us some ideas how to do it over here?
EDIT: The other problem was with games like Super Mario Bros. Before the fix on the XBox went in, unless you named them all
Super Mario Bros. I
,Super Mario Bros. II
andSuper Mario Bros. III
, the first game would be at the end like this:Super Mario Bros. 2
Super Mario Bros. 3
Super Mario Bros -
We've been able to do that on the XBox for quite some time, actually. I'm going to talk to the dev and see what he did to make it work. I know it's automatic there. Maybe that would give us some ideas how to do it over here?
converting roman numeral > integer is a classic programming school homework question. it's very simple, so please don't ask on our behalf ;)
scrapers should populate the sortname in these obvious cases ("The Foo", "Foo IX", "Foo VII" etc)
-
@dankcushions That's cool. I'm not using a scraper for anything, so using this method I'd have to do all of these by hand unless the functionality was put into meleu's script. Not too bad if I only had to do it once, but if I ever created another one down the road from scratch I'd have to do it again.
I figured that part would be easy, I'm just going to find out how the dev did it and post what he says here. There are no tags for XBox emulation, so the program is able to do this based off of something else. There might be a much simpler solution to this issue. I'll let you know what I find out.
-
@joemommasfat said in Skipping "The" in sorting game titles in EmulationStation?:
If you want to use this, change line 139 of ~/RetroPie-Setup/scriptmodules/supplementary/emulationstation.sh
#[[ -z "$repo" ]] && repo="https://github.com/RetroPie/EmulationStation"
[[ -z "$repo" ]] && repo="https://github.com/Joemommasfat/EmulationStation"Then install emulation station from source.
I get an error when I try to install ES from source following these instructions. I'm running RetroPie 4.4, is that the problem?
-
I think that bug should be fixed if you pull from my "stable" branch.
On a related note, does anyone know the procedure for getting changes merged into the default repo? I put in a pull request last year to help with special sorting, that seemed to be well received.
How do I put it to a vote to get it included in the default release?
-
Sorry if this is already in it....
But any way to add this “fix” to the docs?
-
Thanks for the help, @joemommasfat! I got this working on Sunday. It's a great, and essential, update as far as I'm concerned.
-
@sub_atomic glad it worked for you. Maybe @jdrassa can help me get it accepted into the main repo?
-
I can't believe
<sortname>
is not an option. It may just be because I'm using an NES Classic Emulationstation theme, but my sort option is labeled "sort by: filename, ascending".Interestingly, it is not sorting by the filename. It is sorting by the
<name>
node from the gameslist.xml.Even if the sorting did go by filename and the <name> node acted only as the display text, then we could have a secondary sort. But even that is broken.
Should we contact the RetroPie repository administrators to see how to fast track this change? Seems fairly minor for such a useful library management option.
-
@quantastical I thought that sorttitle was added some time ago. Maybe it isn't documented and/or is only available in the dev build.
Edit: Apparently it's
<sortname>
according to this PR https://github.com/RetroPie/EmulationStation/pull/240 and was merged in April. -
You can install the stable branch from my GitHub. Using this tool. I've been using it and it seems to work well.
https://retropie.org.uk/forum/topic/10626/es-devs-and-testers-this-tool-is-for-you
-
@joemommasfat That's not needed if you want to use the latest master branch of Emulationstation. There is an
emulationstation-dev
package in the experimental section which installs it, replacing theemulationstation
package (stable branch).@quantastical install that package and you'll have access to the new features added, as @EctoOne mentioned.
-
Thanks for the quick replies. @mitu, I was able to add the
emulationstation-dev
experimental package thanks to your concise instructions.I was hesitant about going down an unofficial track (using someone else's fork), so this is a nice compromise.
I was able to add
<sortname>...</sortname>
nodes to mygameslist.xml
as needed and it made browsing much more logical.Again, appreciate the responses. Had no idea there was a dev branch I could include experimentally.
-
I found the
emulationstation-dev
branch to be a bit unstable for my likings. For some reason, that build of Emulationstation causes an error with the ALSA sound driver that I wasn't able to resolve. Reverting back to the default build ofemulationstation
eliminated the error.So, I had to come up with a bit of a compromise for sorting. I was able to address alpha/numeric ordering (e.g. 1, II, 3 instead of 1, 3, II) by using a strategically placed, non-visible "zero-width space" character (
​
). For example, the<name>
text for the Mortal Kombat arcade games might be:<name>Mortal Kombat</name> <name>Mortal Kombat II</name> <name>Mortal Kombat ​3</name>
The zero-width space HTML entity will not render in the UI of Emulationstation and it's ASCII value is greater than an alphanumeric character. So, when sorting alphabetically, this eliminates the MK, MK3, MKII issue and correctly moves MK3 after MKII.
This character can be used multiple times and in other scenarios, such as ensuring "Leisure Suit Larry in The Land of the Lounge Lizards" (LSL1) gets sorted before "Leisure Suit Larry Goes Looking for Love (In Several Wrong Places)" (LSL2). The word "in" can be sorted before the word "goes" by using this method. It also allows somewhat arbitrary sorting.
I'm not sure how this affects other areas of Emulationstation. I just know that it is an alternative. One downside is not being able to easily handle sorting articles in the title, such as The and A. Using this zero-width space character at the beginning of every title would be cumbersome and difficult to maintain.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.