Skip to content
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

Non-Steam: SteamGridDB and getid/gettitle Commandline Support #963

Merged
merged 16 commits into from Nov 7, 2023

Conversation

sonic2kk
Copy link
Owner

Heavily WIP, currently does the following:

  • Add a bunch of commands to facilitate parsing shortcuts.vdf
  • Support Non-Steam Games with getIDFromTitle
  • Support Non-Steam Games with getTitleFromID
  • Add support for Non-Steam Games with command steamtinkerlaunch update grid nonsteam (alternatively, update grid shortcut)

Remaining work before I edit this PR description with something more informative and structured:

  • Add support for setting icon for Non-Steam Games with the update grid command
  • Shellcheck fixes

@sonic2kk sonic2kk changed the title Get sgdb for all nonsteam aids [WIP] Non-Steam: SteamGridDB and getid/gettitle Commandline Support Oct 27, 2023
@sonic2kk
Copy link
Owner Author

sonic2kk commented Nov 6, 2023

This PR adds many, many functions for interfacing with the shortcuts.vdf file, including fetching and editing specific entries. These functions will be generally useful and will also allow for, in this PR, updating the icon for Non-Steam Games.

The next step for this PR is to fetch the icon for Non-Steam Games.

@sonic2kk
Copy link
Owner Author

sonic2kk commented Nov 7, 2023

Oh yeah, we'll also need to run shellcheck and do some fixups. I haven't checked yet but I suspect it'll be a real mess...

@sonic2kk
Copy link
Owner Author

sonic2kk commented Nov 7, 2023

Untested implementation for setting the shortcut icon. There are now three mostly untested changes:

  1. getSteamGridDBNonSteamIcon was broken out into a separate function. This works with getGridsForNonSteamGames but I didn't test if it works for addNonSteamGame yet. This needs tested
  2. getSteamGridDBNonSteamIcon now returns the icon path, which we didn't check for before. We need to make sure that this icon path is valid at least for addNonSteamGame, and that it works as expected.
  3. editSteamShortcutEntry was tested during debugging and updated a hardcoded icon path for a given shortcut, but has not been tested in getSteamGridDBNonSteamIcon yet.

I also did a quick run of ShellCheck. No glaring errors, just a couple of style, globbing, and unused/unnecessary variable changes that need addressed. Once the above testing is done and this is all working, it should be straightforward to address those and get this merged.

We're almost there!

@sonic2kk
Copy link
Owner Author

sonic2kk commented Nov 7, 2023

Can't set the icon in getSteamGridDBNonSteamIcon in its current form just yet, because it sets the icon to all the downloading output. Damn! We'll figure out a way though, probably tomorrow.

It is updating the shortcuts.vdf file though, so it will work once we correctly pass it the path for the icon.

@sonic2kk
Copy link
Owner Author

sonic2kk commented Nov 7, 2023

We should also add some more logging before merging this PR.

@sonic2kk
Copy link
Owner Author

sonic2kk commented Nov 7, 2023

Got some rough changes locally that I'll push soon which resolve the remaining functionality issues, and allow icons to be downloaded and set when updating grids for Non-Steam Games! We correctly edit shortcuts.vdf and insert the value.

Some more testing needs to be done, and there is some potential to break out a couple of areas into separate functions, bbut functionally the PR is complete once I push my local changes. Major progress, really just testing and cleanup remains!

@sonic2kk
Copy link
Owner Author

sonic2kk commented Nov 7, 2023

Tested adding Non-Steam Games, setting the icon appears to still work.

@sonic2kk
Copy link
Owner Author

sonic2kk commented Nov 7, 2023

Shellcheck fiixes in place, this is probably ready for merging after a couple more tests...

@sonic2kk
Copy link
Owner Author

sonic2kk commented Nov 7, 2023

Add Non-Steam Game still works, getid/title still works, editing shortcut fields works, I think this is ready to merge! Testing and shellcheck are green and version is bumped. No langfile changes here.

The way we handle which column to edit in editSteamShortcutEntry is perhaps a little inefficient in that it uses a case statement, but eh, I think it's fine. It's for internal use only anyway, in future if there's demand it would be easy to expose on the commandline though.


I never did update the PR description but I think it's fine.

@sonic2kk sonic2kk changed the title [WIP] Non-Steam: SteamGridDB and getid/gettitle Commandline Support Non-Steam: SteamGridDB and getid/gettitle Commandline Support Nov 7, 2023
@sonic2kk sonic2kk merged commit cc0cd85 into master Nov 7, 2023
@sonic2kk sonic2kk linked an issue Nov 7, 2023 that may be closed by this pull request
11 tasks
@sonic2kk sonic2kk deleted the get-sgdb-for-all-nonsteam-aids branch November 8, 2023 00:40
@sonic2kk sonic2kk linked an issue Nov 8, 2023 that may be closed by this pull request
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Non-Steam Game Improvements [Feature Request] Overhaul SteamGridDB Integration
1 participant