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

Load entire appinfo.vdf since loading selectively is broken #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jonathing
Copy link

@Jonathing Jonathing commented Sep 30, 2024

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.

@tralph3
Copy link
Owner

tralph3 commented Sep 30, 2024

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

Are you by any chance using the Flatpak version?

@Jonathing
Copy link
Author

Jonathing commented Oct 2, 2024

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

@tralph3
Copy link
Owner

tralph3 commented Oct 2, 2024

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).

@Jonathing
Copy link
Author

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
Copy link
Author

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.

@tralph3
Copy link
Owner

tralph3 commented Oct 5, 2024

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!

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.

2 participants