This commit is contained in:
kramo
2023-04-19 22:26:54 +02:00
parent 3cfb3c5028
commit 2b2b7e0c75
6 changed files with 24 additions and 52 deletions

View File

@@ -17,9 +17,9 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
import hashlib
import json
import os
from hashlib import sha256
from pathlib import Path
from time import time
@@ -102,7 +102,7 @@ def heroic_importer(win):
image_path = (
heroic_dir
/ "images-cache"
/ hashlib.sha256(
/ sha256(
(f'{game["art_square"]}?h=400&resize=1&w=300').encode()
).hexdigest()
)
@@ -143,7 +143,7 @@ def heroic_importer(win):
image_path = (
heroic_dir
/ "images-cache"
/ hashlib.sha256(game["art_square"].encode()).hexdigest()
/ sha256(game["art_square"].encode()).hexdigest()
)
values["executable"] = (
@@ -193,7 +193,7 @@ def heroic_importer(win):
image_path = (
heroic_dir
/ "images-cache"
/ hashlib.sha256(item["art_square"].encode()).hexdigest()
/ sha256(item["art_square"].encode()).hexdigest()
)
importer.save_game(values, image_path if image_path.exists() else None)

View File

@@ -171,7 +171,7 @@ def itch_importer(win):
ON
caves.game_id = games.id
;
"""
"""
connection = connect(database_tmp_path)
cursor = connection.execute(db_request)

View File

@@ -96,7 +96,7 @@ def lutris_importer(win):
AND configPath IS NOT NULL
AND installed IS TRUE
;
"""
"""
connection = connect(database_tmp_path)
cursor = connection.execute(db_request)