-
Notifications
You must be signed in to change notification settings - Fork 128
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
Further improve steam shortcut creation #368
Conversation
- Search if shortcut already exists - Only set values we're caring about - Append non existent tags - Correctly set the icon and the horizontal grid image
They're replaced by collections.
Looks like SteamGridDB Manager can create categories for new library. |
Great find! I'll try around with it. |
Adding and updating games to steams collection is working now. Still a few things left, what do you think:
|
Yes. They are likely still being used in Big Picture and old library, there's probably some other legacy code that may use them.
Currently GOG tags are imported if option is enabled. I think tags import and export functionality should be abstracted and be implementable for sources. Also it would be nice for GameHub to backup any Steam configs it changes to not accidentally remove existing shortcuts and categories. |
Ok, that doesn't belong in this PR.
I've added copying the database before writing into it. |
Great work. I'll test it later. Do you have any ideas how tags sync should work? (UI discussion for this should probably be in #304) |
Resolved some remaining issues I've found.
Two possibilities:
IMHO is option 2 the better option (at least for steam). The leveldb database should only be used by one program at a time and on a button press or something similar we can tell the user why it's currently not possible. From the technical side we can just read the leveldb entries. A random id is assigned with a name, an array of added games and an array of removed (hidden from this collection) games. We could query an appid to get all collections the game is assigned to and add them to our database and expose the imported tag like it's already done with gog. When adding games to it we're writing into the localconfig.vdf for added games. Not sure if we should remove games by adding them to the removed array in the vdf or remove them from the added array in the leveldb. Probably better to add them to the removed array in the vdf since doZenn mentioned:
|
public static string generate_new_appid(string exe, string name) | ||
{ | ||
// https://github.com/boppreh/steamgrid/blob/master/games.go#L120 | ||
return (crc32(0, (exe + name).data) | 0x80000000).to_string(); | ||
} |
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.
This is now replaced by a 4 byte little endian "appid" in the shortcut.vdf.
BigPicture is still using this tho. ((crc32(taget+name)|0x80000000)<<32|0x02000000)
|
||
game_node.add_node(new BinaryVDF.StringNode.node("AppName", game.name)); | ||
game_node.add_node(new BinaryVDF.StringNode.node("appname", game.name)); |
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.
We need to test if intentionally not setting "appid" here makes steam use the old format as "appid". (target+name…)
If it has that effect: good, we can predict the artwork name.
If not: new appid generation is currently unknown so we can't create shortcuts and set the artwork in one go.
Tags seem to be entirely replaced by collections. Unfortunately I haven't found a way to create them and assign the games to them.
It's possible to see them through the inbuild chrome browser by starting with
steam -dev
and accessing the browsers console withF12
. They're located in the local storage.The files representing that in the file system are located at
$XDG_DATA_HOME/Steam/config/htmlcache/Local Storage/leveldb/
.References: