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

game_times.json is empty #20

Closed
JakeKydd opened this issue Jan 1, 2020 · 7 comments
Closed

game_times.json is empty #20

JakeKydd opened this issue Jan 1, 2020 · 7 comments

Comments

@JakeKydd
Copy link

JakeKydd commented Jan 1, 2020

The game_times.json seems to be empty even after PS2 games are added to Gog Galaxy via the giant bomb method. Is this intended? I wanted to update my game times for my existing PS2 games and if possible add some game times for games on other platforms (mainly PS4)

@JakeKydd
Copy link
Author

JakeKydd commented Jan 2, 2020

By temporarely reversing the if not statement (when checking if the game_times.json file already exists) I managed to get the file populated and can now edit the game time manually. Great, thank you for this!

Is it possible to update game times for all games or only those added by this integration? So far I haven't found a way to determine game ids for games from other integrations/platforms.

@WaelALR
Copy link

WaelALR commented Jan 16, 2020

@JakeKydd How did you repopulate the game_times.json file. I'm having the same problem.

@fransubie
Copy link

@JakeKydd ¿Cómo repobló el archivo game_times.json? Estoy teniendo el mismo problema.

I have that problem too

@NoShotz
Copy link

NoShotz commented Jan 29, 2020

Yeah, I can't get times to track or the file to even exist.

@NoShotz
Copy link

NoShotz commented Jan 29, 2020

Well I got it to appear but it still doesn't populate.

@NoShotz
Copy link

NoShotz commented Jan 29, 2020

@fransubie I found a workaround open the plugin.py and change

if not os.path.exists(path):
            os.makedirs(os.path.dirname(path))
            for game in self.games:
                data[game.id] = { "name": game.name, "time_played": 0, "last_time_played": None }

            with open(path, "w", encoding="utf-8") as game_times_file:
                json.dump(data, game_times_file, indent=4)

to

if os.path.exists(path):
            #os.makedirs(os.path.dirname(path))
            for game in self.games:
                data[game.id] = { "name": game.name, "time_played": 0, "last_time_played": None }

            with open(path, "w", encoding="utf-8") as game_times_file:
                json.dump(data, game_times_file, indent=4)

Then start up Galaxy 2.0 and the json file should populate, then change it back to how it was and restart Galaxy 2.0

@AHCoder
Copy link
Owner

AHCoder commented Feb 22, 2020

This should be fixed with the latest version, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants