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

Latest commits broke the script #98

Open
PauloGDPeixoto opened this issue Dec 21, 2023 · 14 comments
Open

Latest commits broke the script #98

PauloGDPeixoto opened this issue Dec 21, 2023 · 14 comments

Comments

@PauloGDPeixoto
Copy link

PauloGDPeixoto commented Dec 21, 2023

I'm having errors while trying to update the manifest file. Every game gives an error similar to the following:

22:19:55 | (  1 / 901) fetching game details for 140_game...
22:20:04 |   -> title has changed "140_game" -> "140"
22:20:04 | The handled exception was:
22:20:04 | error
Traceback (most recent call last):
  File "/run/media/2844327D5A8D495D/gog/../gogrepoc/gogrepoc.py", line 313, in __getattr__
    return self[key]
           ~~~~^^^^^
KeyError: 'folder_name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/run/media/2844327D5A8D495D/gog/../gogrepoc/gogrepoc.py", line 1715, in cmd_update
    handle_game_updates(gamesdb[item_idx], item,strict)
  File "/run/media/2844327D5A8D495D/gog/../gogrepoc/gogrepoc.py", line 657, in handle_game_updates
    if olditem.folder_name != newitem.folder_name:
                              ^^^^^^^^^^^^^^^^^^^
  File "/run/media/2844327D5A8D495D/gog/../gogrepoc/gogrepoc.py", line 315, in __getattr__
    raise AttributeError(key)
AttributeError: folder_name
22:20:04 | End exception report.
@Kalanyr
Copy link
Owner

Kalanyr commented Dec 22, 2023 via email

@PauloGDPeixoto
Copy link
Author

PauloGDPeixoto commented Dec 22, 2023

I'm using python 3.12. And I can confirm that reverting three commits (to commit 948cbf0), the script works as expected.

@Kalanyr
Copy link
Owner

Kalanyr commented Dec 23, 2023

Hmm, I'm running 3.11 so it must be an intersection of those changes and 3.12 that's annoying, I'm not seeing anything that should cause errors from the 3.12 changelog at a glance (might be from modules that have been updated that I haven't updated too I guess ).

I'll install python 3.12 and see if I can find the problem.

@Kalanyr
Copy link
Owner

Kalanyr commented Dec 23, 2023

Ahh, okay, it's not 3.12 I think, you've somehow got new items in your manifest that aren't in the updated format, I don't understand how that's possible but I can write some code to account for the situation.

@Kalanyr
Copy link
Owner

Kalanyr commented Dec 23, 2023

I see a 2nd possible issue which is that there's apparently a game with a slug that's just a number now, which is not ideal but lets see if solving problem 1 resolves your immediate issues before I have to dive into python Attribute rules.

Could you please try the attached file and let me know if it solves your issue ?

gogrepoc-troubleshoot.zip

@PauloGDPeixoto
Copy link
Author

First of all, thanks for being so prompt! This issue happened to all items, the first one just happens to have a number for a name, but the same error repeats for all games.
The items in the manifest that aren't in the updated format sounds plausible, although I've been using gogrepoc for some time now, it seems weird to have this issue now, specially considering that a rollback to the script fixes the issue.

Anyway, I apologize, but I'll be offline for the weekend, I can test the manifest you mentioned next Monday night.

@Kalanyr
Copy link
Owner

Kalanyr commented Dec 23, 2023 via email

@PauloGDPeixoto
Copy link
Author

I see a 2nd possible issue which is that there's apparently a game with a slug that's just a number now, which is not ideal but lets see if solving problem 1 resolves your immediate issues before I have to dive into python Attribute rules.

Could you please try the attached file and let me know if it solves your issue ?

gogrepoc-troubleshoot.zip

This does indeed solve the issue! Below is a a bit of output:

22:29:33 | loading local manifest...
22:29:34 | loading token...
22:29:34 | loading local resume manifest...
22:29:34 | incomplete update detected, resuming...
22:29:34 | saving resume manifest...
22:29:35 | saved resume manifest
22:29:35 | (  1 / 900) fetching game details for 140_game...
22:29:35 | refreshing token
22:29:35 | saving token...
22:29:35 | saved token
22:29:35 | refreshed token
22:29:39 |   -> title has changed "140_game" -> "140"
22:29:39 |   -> folder name has changed "140_game" -> "140"
22:29:39 | (  2 / 900) fetching game details for 15_days...
22:29:42 |   -> title has changed "15_days" -> "15 Days"
22:29:42 |   -> folder name has changed "15_days" -> "15 Days"
22:29:42 | (  3 / 900) fetching game details for 1954_alcatraz...
22:29:46 |   -> title has changed "1954_alcatraz" -> "1954 Alcatraz"
22:29:46 |   -> folder name has changed "1954_alcatraz" -> "1954 Alcatraz"
22:29:46 | (  4 / 900) fetching game details for 198x...
22:29:54 |   -> title has changed "198x" -> "198X"
22:29:54 |   -> folder name has changed "198x" -> "198X"
22:29:54 | (  5 / 900) fetching game details for 1nsane...
22:29:58 | (  6 / 900) fetching game details for a_bird_story...
22:30:08 |   -> title has changed "a_bird_story" -> "A Bird Story"
22:30:08 |   -> folder name has changed "a_bird_story" -> "A Bird Story"

@Kalanyr
Copy link
Owner

Kalanyr commented Dec 26, 2023 via email

@Kalanyr
Copy link
Owner

Kalanyr commented Dec 27, 2023

This is absolutely bizarre I just tried logging in on Python 3.12 and it all works properly (folders are correctly generated with the short name), I did get one deprecation warning but it's unrelated to your issue..

You're obviously using Linux though and I don't have a Linux test environment available right now (my Linux environment is currently busted and I'm probably not going to have a chance to fix it for at least a couple of weeks ).

@Kalanyr
Copy link
Owner

Kalanyr commented Dec 27, 2023

hmm Could you try backing up your gog-manifest.dat and gog-resume-manifest.dat file somewhere, then deleting the current ones and letting it run an update (don't try to download as the renamed folders will break the recognition )

If you could send a copy of the original gog-manifest.dat and gog-resume-manifest.dat to my email ( kalanyrDeleteTheseWords AT gmail DOT com ) that would be very helpful, I'll see if there's enough information in there to write a script to fix the folder names for you.

@PauloGDPeixoto
Copy link
Author

hmm Could you try backing up your gog-manifest.dat and gog-resume-manifest.dat file somewhere, then deleting the current ones and letting it run an update (don't try to download as the renamed folders will break the recognition )

If you could send a copy of the original gog-manifest.dat and gog-resume-manifest.dat to my email ( kalanyrDeleteTheseWords AT gmail DOT com ) that would be very helpful, I'll see if there's enough information in there to write a script to fix the folder names for you.

Currently doing this, but it will take some time, I'll send it to you as soon as it's done, thanks!

@PauloGDPeixoto
Copy link
Author

hmm Could you try backing up your gog-manifest.dat and gog-resume-manifest.dat file somewhere, then deleting the current ones and letting it run an update (don't try to download as the renamed folders will break the recognition )

If you could send a copy of the original gog-manifest.dat and gog-resume-manifest.dat to my email ( kalanyrDeleteTheseWords AT gmail DOT com ) that would be very helpful, I'll see if there's enough information in there to write a script to fix the folder names for you.

Email sent!

@Kalanyr
Copy link
Owner

Kalanyr commented Dec 31, 2023 via email

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

No branches or pull requests

2 participants