Use Steam API as the local cache is not reliable

This commit is contained in:
kramo
2023-03-15 21:08:37 +01:00
parent 56f5d99b89
commit 86f707694d
4 changed files with 84 additions and 94 deletions

View File

@@ -21,6 +21,10 @@ import sys
import time
import gi
gi.require_version("Gtk", "4.0")
gi.require_version("Adw", "1")
from gi.repository import Adw, Gio, GLib, Gtk
from .bottles_parser import bottles_parser
@@ -34,9 +38,6 @@ from .steam_parser import steam_parser
from .toggle_hidden import toggle_hidden
from .window import CartridgesWindow
gi.require_version("Gtk", "4.0")
gi.require_version("Adw", "1")
class CartridgesApplication(Adw.Application):
def __init__(self):
@@ -130,9 +131,8 @@ class CartridgesApplication(Adw.Application):
PreferencesWindow(self.win).present()
def on_steam_import_action(self, _widget, _callback=None):
games = steam_parser(self.win, self.on_steam_import_action)
save_games(games)
self.win.update_games(games.keys())
# Handle the updating of games inside of the module because the function is async.
steam_parser(self.win, self.on_steam_import_action)
def on_heroic_import_action(self, _widget, _callback=None):
games = heroic_parser(self.win, self.on_heroic_import_action)