Cleanups
This commit is contained in:
@@ -65,17 +65,17 @@ def resize_cover(win, cover_path=None, pixbuf=None):
|
|||||||
|
|
||||||
|
|
||||||
def save_cover(win, game_id, cover_path):
|
def save_cover(win, game_id, cover_path):
|
||||||
if not cover_path:
|
|
||||||
return
|
|
||||||
|
|
||||||
win.covers_dir.mkdir(parents=True, exist_ok=True)
|
win.covers_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
animated_path = win.covers_dir / f"{game_id}.gif"
|
animated_path = win.covers_dir / f"{game_id}.gif"
|
||||||
static_path = win.covers_dir / f"{game_id}.tiff"
|
static_path = win.covers_dir / f"{game_id}.tiff"
|
||||||
|
|
||||||
# Remove previous covers
|
# Remove previous covers
|
||||||
(animated_path).unlink(missing_ok=True)
|
animated_path.unlink(missing_ok=True)
|
||||||
(static_path).unlink(missing_ok=True)
|
static_path.unlink(missing_ok=True)
|
||||||
|
|
||||||
|
if not cover_path:
|
||||||
|
return
|
||||||
|
|
||||||
copyfile(
|
copyfile(
|
||||||
cover_path,
|
cover_path,
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ class SGDBSave:
|
|||||||
Gio.Task.new(None, None, self.task_done).run_in_thread(create_func(game))
|
Gio.Task.new(None, None, self.task_done).run_in_thread(create_func(game))
|
||||||
|
|
||||||
def update_cover(self, task, game):
|
def update_cover(self, task, game):
|
||||||
|
if not self.importer:
|
||||||
|
game.set_loading(1)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
not (
|
not (
|
||||||
self.win.schema.get_boolean("sgdb")
|
self.win.schema.get_boolean("sgdb")
|
||||||
@@ -43,9 +46,6 @@ class SGDBSave:
|
|||||||
task.return_value(game)
|
task.return_value(game)
|
||||||
return
|
return
|
||||||
|
|
||||||
if not self.importer:
|
|
||||||
game.set_loading(1)
|
|
||||||
|
|
||||||
url = "https://www.steamgriddb.com/api/v2/"
|
url = "https://www.steamgriddb.com/api/v2/"
|
||||||
headers = {"Authorization": f'Bearer {self.win.schema.get_string("sgdb-key")}'}
|
headers = {"Authorization": f'Bearer {self.win.schema.get_string("sgdb-key")}'}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user