fix(repair): join game path with pkg_version

This commit is contained in:
tretrauit 2024-06-06 20:17:22 +07:00
parent f5e7417cdf
commit acd457babe

View File

@ -157,18 +157,17 @@ def repair_game(
pkg_version = [] pkg_version = []
if not pkg_version_file.is_file(): if not pkg_version_file.is_file():
try: try:
game.repair_file("pkg_version", game_info=game_info) game.repair_file(game.path.joinpath("pkg_version"), game_info=game_info)
except Exception as e: except Exception as e:
raise RepairError( raise RepairError(
"pkg_version file not found, most likely you need to download the full game again." "pkg_version file not found, most likely you need to download the full game again."
) from e ) from e
else: with pkg_version_file.open("r") as f:
with pkg_version_file.open("r") as f: for line in f.readlines():
for line in f.readlines(): line = line.strip()
line = line.strip() if not line:
if not line: continue
continue pkg_version.append(json.loads(line))
pkg_version.append(json.loads(line))
repair_executor = concurrent.futures.ThreadPoolExecutor() repair_executor = concurrent.futures.ThreadPoolExecutor()
for file in pkg_version: for file in pkg_version: