-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to ignore common leading articles in Filename sort #729
Conversation
Wow. Ok, a lot to unpack here - thanks for putting this together! I have not yet read through the code, much less tested it, but I wanted to add some remarks and ask about some testing scenarios, as the sorting logic isn't always as trivial as it seems from my previous interactions with it.
Other than these remarks - and the item in point number 1, this looks like something that can be useful. Thanks for putting it together, and do share your feedback and notes on these remarks, especially as I may have misunderstood some of them. Have a great weekend! |
Thanks for checking this so quickly. I agree that the sorting logic can be complex in some ways. Allow me to break my answers down a bit... 1a. I was not aware that there are existing use cases for session-only nor system-only sorting. I actually tried to think of reasons why someone would want to do either or both, and it seemed (on the surface) that it wasn't as useful as retaining the information and restoring it. I also noticed there's a TODO remark on line 74 of 1b. With that said, I'm curious. What are the use cases for both of the above (session-only and system-only)? I'd like to understand them better. 1c. I concur that it's a departure from long-standing functionality, and though I take that very seriously from a UX perspective, it seemed like the right shift to make given the scenario. 1d. When you mention an option for "default sorting", are you suggesting that the two would work in tandem? e.g. The START menu would retain the added field and apply it as I'm doing it within this PR, but the SELECT menu would also retain its current field which would act as a session-only, system-only override? If so, I think something like that could work.
I'm interested in learning more and looking forward to your feedback, especially on point 1d. Enjoy the rest of your weekend as well! |
Hi. Thanks for the reply, let me clarify what I was raising. 1a, 1b and 1c. Well, I mean, yes: the current sorting has been session-only and system-only, and meant to address session specific needs. For instance, in a session the user wants to sort the games by rating to find a game to play that is highly rates, or sort by release date to play games from a specific date range. I'm just sharing the two I use the most (other than alphabetical, of course, which is the easiest to navigate by default, I imagine). If you'd want to learn more, certainly asking in the forums for "what do users use the sorting option for" could help better understand what is (and what isn't) used. But right now, having it always persist means that if the user changes the sorting for whatever reason on its session, he needs to deliberately go back and revert it every time, otherwise risking having the sort of every single system persist in a different manner. 1d. Yes, that was my immediate suggestion, but I didn't really think this through in any extensive manner. I was just looking for a way for this change to work, while respecting the current use cases. I'm not saying it's the best solution or that it should be done - just raising it as a possibility.
Just that. Let me know if this helps, or if anything isn't clear. Thanks, and have a great week ahead! |
More follow-ups: 1a-c. Thanks, I understand what you mean now. 1d. Understood that it was an off-the-cuff solution. The more I think of it, though, I believe it could work. Functionally, it makes sense, and I think it could be separated in such a way that it would work.
With all of that said, it sounds like there are two available options:
What are your thoughts on that? |
Thanks for the reply - and thanks for checking those scenarios. I agree with the split of the PRs, and then submitting those as different PRs indeed for the sake of traceability and future maintainability. In regards to the Collection Manager, see if it should be updated in any way to conform with your enum changes. Best. |
9d6d7dc
to
8f0aecc
Compare
@pjft I've isolated the I'll submit a separate PR for the other piece once I get a chance to test it further. Thanks for stepping through this with me! |
Thanks. I currently don't have access to a Pi, but I will go through the code soon. |
es-app/src/guis/GuiMenu.cpp
Outdated
{ | ||
//Apply sort recursively | ||
FileData* root = (*it)->getRootFolder(); | ||
root->sort(FileSorts::SortTypes.at(Settings::getInstance()->getInt("SortType"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PhilaPhan80 I was testing this today, and it works well but this setting should be part of the future PR, not this one, correct?
If you can fix this I'll test it again and merge it, as I have a Pi3 available for a while for these.
Apologies for the delay, and thanks for putting this together.
@pjft Thanks for diving deeper into this. The section you highlighted is intended to immediately sort all systems so that the user's choice is reflected. I couldn't find an existing way to trigger a sort across all systems, so I copied some of the sorting code and placed it here within a |
Apologies - what I meant was that "Settings::getInstance()->getInt("SortType"))" isn't defined in this PR. I got that error when turning on the option - "lvl0: Tried to use unset setting SortType!". :) |
Oh, gotcha. Sorry about that. I've replaced it with the following so it picks up on each system's specific sort preference. |
Thanks. Tested it, works fine. If you'd want to squash the commits into a single one, I'll merge it tomorrow. If you want to announce it in the forums for testing it'd be awesome for further testing then. Thank you. |
1c2bad3
to
da74a45
Compare
Great! Just squashed it. Is there a specific place where I should announce that? (I've never used the forums here.) |
In the RetroPie forums, at https://retropie.org.uk/forum/ - just create a post in "Ideas and Development", and let them know it's on emulationstation-dev (after we merge it). Apologies for nitpicking, but can you change the commit name and description to be reflective of what's being added here, as that's what will stay in the history for others to trace things down? :) |
@pjft Thanks! I'll wait to hear from you before posting anything to the forum. I'm sorry, I'm not well-versed in Git, and I'm doing everything through GitHub.com and VS Code. I'm not sure how to change the commit name and description. If you can offer some sample commands, I'll be happy to perform them. |
Of course, not a bother. From https://docs.github.com/en/github/committing-changes-to-your-project/changing-a-commit-message , if you have git installed on your computer I suspect you'd do the following on the project directory:
them write the message in the right commit, and finally
But let me know if you run into any trouble. Thank you! |
da74a45
to
cfa50d0
Compare
@pjft Thanks! I think that worked. Let me know if there's anything else you need me to do. |
Thank you for sending this over! Feel free to share the good news in the forums, I'm sure others will benefit from this change. It's available in the emulationstation-dev package. Thanks. |
Any ideas of when an up-to-date public build of ES is coming? Ignoring articles on sort is a game changer (and part of basic title sorting 101) |
This enhancement replaces #726 by adding an option called
Ignore Articles (Name Sort Only)
to the START menu. When enabled, common leading articles are ignored in both ascending and descending order while sorting each system's game titles, similar to popular multimedia-based systems. The comma-delimited list of articles is stored within thees_settings.cfg
file asLeadingArticles
. By default, common English articles "a", "an", and "the" are ignored, and others may be added to the list manually. (This also allows more articles to be easily added to the default setting going forward.) The option itself is persisted asIgnoreLeadingArticles
.Additionally, all file sorting options are consolidated into one application-wide location by moving theSort Games By
selection from the SELECT menu to the START menu (see attached image). Upon value change, the selection is applied to all systems across the board, and theSortType
ID is stored within the settings file so it can be restored upon restart/reboot.Lastly, a popup message is displayed whenever sorting has been re-performed in response to either of the above selections.Additionally, a popup message is displayed whenever sorting has been re-performed in response to the selection above.
Changes:
Ignore Articles (Name Sort Only)
option to the UI Settings (START) menuIgnoreLeadingArticles
boolean to settingsLeadingArticles
string to settingsIgnoreLeadingArticles
selection across all systems on value change and ES startupMovesSort Games By
option from the Options (SELECT) menu to the UI Settings (START) menuAddsSortType
enum toFileSorts
namespace so values can be uniquely referenced by IDAddsSortType
int to settingsAppliesSortType
selection across all systems on value change and ES startupNotes:
IgnoreLeadingArticles
logic cannot be applied to sort types other than Filename ASC/DESC due to the way the sorting logic compares two files without any outside knowledge of broader intent or scope. Currently, other sort types group files by their associated comparator (e.g. Rating, Times Played, Developer, etc.). Ideally, though, the names within each group would be alphabetized ASC/DESC. For example, sorting by year would display something like1998 A-Z
,1995 A-Z
,1986 A-Z
, etc. (or1998 Z-A
,1995 Z-A
,1986 Z-A
if DESC). Without that logic in place,IgnoreLeadingArticles
currently doesn't make sense outside the scope of Filename.