mirror of
https://github.com/lutris/lutris
synced 2024-10-04 14:59:37 +00:00
Guard against use of sync_local_library when the user is not logged in.
Let's not take an exception for this. It happens on each Lutris startup, if you aren't logged in already.
This commit is contained in:
parent
1f1f00d345
commit
63a2f110df
|
@ -237,10 +237,10 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate, DialogInstallU
|
|||
if value.accel:
|
||||
app.add_accelerator(value.accel, "win." + name)
|
||||
|
||||
def sync_library(self):
|
||||
def sync_library(self, force=False):
|
||||
"""Tasks that can be run after the UI has been initialized."""
|
||||
if settings.read_setting("library_sync_enabled"):
|
||||
AsyncCall(sync_local_library, None)
|
||||
AsyncCall(sync_local_library, None, force=force)
|
||||
|
||||
def update_action_state(self):
|
||||
"""This invokes the functions to update the enabled states of all the actions
|
||||
|
@ -844,8 +844,7 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate, DialogInstallU
|
|||
return True
|
||||
|
||||
def on_lutris_account_connected(self):
|
||||
if settings.read_bool_setting("library_sync_enabled"):
|
||||
AsyncCall(sync_local_library, None, force=True)
|
||||
self.sync_library(force=True)
|
||||
|
||||
def on_local_library_updated(self):
|
||||
self.redraw_view()
|
||||
|
|
|
@ -54,6 +54,9 @@ def sync_local_library(force: bool = False) -> None:
|
|||
local_library = get_local_library()
|
||||
local_library_updates = get_local_library(since=since)
|
||||
credentials = read_api_key()
|
||||
if not credentials:
|
||||
return
|
||||
|
||||
url = LIBRARY_URL
|
||||
if since:
|
||||
url += "?since=%s" % since
|
||||
|
|
Loading…
Reference in a new issue