-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
[Fix] Steam Shortcuts / Make checkIfAlreadyAdded case-insensitive #3320
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
I'm curious, is heroic adding the information with the wrong case for the key? or is steam transforming them in some way? because maybe we should make heroic use whatever case steam expects instead? do you have an example of this data with keys that are not |
It's a bit more than that based on #2030 Apparently Steam isn't 100% consistent on the use of case and can vary over time or OSes, but that doesn't matter to Steam because it doesn't appear to care about the case at all (you can use randomized case with no issues). However, Steam does like to convert entrees to whatever case is standard for it at the moment. So Heroic can't really rely on just changing |
I just realized that a change needs to be made to |
I've committed the change to removeNonSteamGame and tested it on my install. After: It's basically the same as the first change and I don't see any other points where the shortcuts file is being accessed that way, so it should be complete. |
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.
maybe this is a bit nitpicky, but since we already have something similar in this function
maybe we move getting the value to a function too for consistency:
function getAppName(object) {
const foundKey = Object.keys(object).find((key) => key.toLowerCase() === 'appname') ?? 'AppName'
return object[foundKey]
}
then you can do return getAppName(shortcuts)
and const appName = getAppName(surtcubOjb)
This change should make checkIfAlreadyAdded insensitive to the case of 'AppName' so if it changes it'll still be recognized and able to be removed and not double added.
Move title finding to separate function for consistency
@arielj Nitpicky or not, it's not a big deal and it helps with consistency. Had I noticed that other function then I likely would've implemented it the same way. Bonus is that it helps keep the other functions cleaner. |
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.
Looks good to me 👍
This change should make checkIfAlreadyAdded insensitive to the case of 'AppName' so if it changes it'll still be recognized and able to be removed and not double added.
Fixes #3124
Change is based on this StackOverflow post
Tested but not on a completely clean install
Use the following Checklist if you have changed something on the Backend or Frontend: