Steam-Metadata-Editor icon indicating copy to clipboard operation
Steam-Metadata-Editor copied to clipboard

Load entire appinfo.vdf since loading selectively is broken

Open Jonathing opened this issue 1 year ago • 6 comments

Name entails. Normally this doesn't affect the user at all, but when trying to run the program with the --silent flag, it immediately crashes due to an indexing error. It probably has something to do with how you are reading the VDF file. The reason I made this PR rather than simply opening up an issue was because since #50 exists, I'd imagine all the work into cleaning up how the application works would be put into the GTK rewrite.

Of course, this PR is a really quick and dirty fix to a problem that I hope would be solved by the GTK rewrite. When this program is loaded in GUI mode, the "save" button indiscriminately writes to the entire appinfo.vdf file, since it doesn't load it selectively like the silent or export flags do. Since this merely makes it so that silent mode loads the entire appinfo.vdf file, just like how it would in the normal GUI mode, the only real impact here is performance.

Jonathing avatar Sep 30 '24 20:09 Jonathing

Sorry, could you show me the error? I can't reproduce.

Are you by any chance using the Flatpak version?

tralph3 avatar Sep 30 '24 22:09 tralph3

Here you go

Traceback (most recent call last):
  File "/home/jonathing/Development/git/.quick-forks/Steam-Metadata-Editor/src/main.py", line 46, in <module>
    main()
  File "/home/jonathing/Development/git/.quick-forks/Steam-Metadata-Editor/src/main.py", line 35, in main
    main_window = MainWindow()
                  ^^^^^^^^^^^^
  File "/home/jonathing/Development/git/.quick-forks/Steam-Metadata-Editor/src/gui/main_window.py", line 66, in __init__
    self.appinfo = Appinfo(
                   ^^^^^^^^
  File "/home/jonathing/Development/git/.quick-forks/Steam-Metadata-Editor/src/appinfo.py", line 71, in __init__
    self.parsedAppInfo[app] = self.read_app(app)
                              ^^^^^^^^^^^^^^^^^^
  File "/home/jonathing/Development/git/.quick-forks/Steam-Metadata-Editor/src/appinfo.py", line 180, in read_app
    app["sections"] = self.parse_subsections()
                      ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jonathing/Development/git/.quick-forks/Steam-Metadata-Editor/src/appinfo.py", line 123, in parse_subsections
    key = self.read_string_appinfo29()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jonathing/Development/git/.quick-forks/Steam-Metadata-Editor/src/appinfo.py", line 87, in read_string_appinfo29
    return self.string_pool[index]
           ~~~~~~~~~~~~~~~~^^^^^^^
IndexError: list index out of range
[ble: exit 1]

I am not using the Flatpak version. I am using the repo itself and have steammetadataeditor set to this script:

#!/bin/bash

/usr/bin/env python3 $HOME/Development/git/.quick-forks/Steam-Metadata-Editor/src/main.py $@

Here are my config files: https://gist.github.com/Jonathing/111feccb983dfcb4133c340e99363cf6

Jonathing avatar Oct 02 '24 04:10 Jonathing

I see. Can you send me your appinfo.vdf file? Located in ~/.local/share/Steam/appcsche/appinfo.vdf.

I don't think loading the entire file is a proper solution (at least not without a deeper investigation into the issue).

tralph3 avatar Oct 02 '24 13:10 tralph3

Sure. Here you go: appinfo.vdf.zip

I had to compress it into a ZIP file because GitHub wouldn't accept it otherwise. If you want me to upload it some other way, let me know.

Jonathing avatar Oct 02 '24 19:10 Jonathing

Updated the PR description with additional clarifications, since looking back on it it was probably a little rude (sorry 😅). My impression is that the python code-base is being put into a freeze while the GTK rewrite in #50 is being worked on, which is why I made this quick-fix PR.

Jonathing avatar Oct 03 '24 15:10 Jonathing

Don't worry, you didn't come off as rude.

Yes, I don't want to touch the current codebase much, since it's done much better in the GTK version.

I haven't had the time to take a look at the issue yet. If it ends up being too complicated I may end up accepting the PR.

Cheers!

tralph3 avatar Oct 05 '24 15:10 tralph3