Add progress bar + fix race condition

This commit is contained in:
kramo
2023-03-24 14:07:00 +01:00
parent 5b839c9f6f
commit d5a640bd0b
2 changed files with 13 additions and 5 deletions

View File

@@ -29,8 +29,6 @@ def save_cover(game, parent_widget, file_path, pixbuf=None, game_id=None):
"cartridges",
"covers",
)
if not os.path.exists(covers_dir):
os.makedirs(covers_dir)
if game_id is None:
game_id = game["game_id"]
@@ -41,6 +39,9 @@ def save_cover(game, parent_widget, file_path, pixbuf=None, game_id=None):
def cover_callback(*_unused):
pass
if not os.path.exists(covers_dir):
os.makedirs(covers_dir)
open_file = Gio.File.new_for_path(os.path.join(covers_dir, game_id + ".tiff"))
parent_widget.pixbufs[game_id] = pixbuf
pixbuf.save_to_streamv_async(