From c6556b8f2bdf425c3f83f538dac21574c4eefbe6 Mon Sep 17 00:00:00 2001 From: Alexandre Pulido Date: Tue, 13 Aug 2024 21:43:57 +0200 Subject: [PATCH] fix: correct Title ID and version identification for DLC Fix found by @PortableProgrammer in #97 --- app/app.py | 2 +- app/titles.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/app.py b/app/app.py index 0d83207..9206847 100644 --- a/app/app.py +++ b/app/app.py @@ -251,7 +251,7 @@ def generate_library(): else: app_id_version_from_versions_txt = get_app_id_version_from_versions_txt(title['app_id']) if app_id_version_from_versions_txt is not None: - if title['version'] == int(app_id_version_from_versions_txt): + if int(title['version']) == int(app_id_version_from_versions_txt): dlc_has_latest_version = True else: dlc_has_latest_version = False diff --git a/app/titles.py b/app/titles.py index 2c7fa2d..e3e9dc6 100644 --- a/app/titles.py +++ b/app/titles.py @@ -81,7 +81,8 @@ def identify_appId(app_id): title_id = app_id[:-3] + '000' else: app_type = APP_TYPE_DLC - title_id = app_id[:-3] + '000' + base_hex = app_id[:-3] + title_id = hex(int(base_hex, base=16) - 1)[2:].rjust(len(base_hex), '0') + '000' return title_id.upper(), app_type @@ -243,7 +244,7 @@ def get_all_dlc_existing_versions(app_id): print(f'No keys in cnmts.json for DLC app ID: {app_id.upper()}') return None else: - print(f'DLC app ID not in cnmts.json: {app_id.upper()}') + # print(f'DLC app ID not in cnmts.json: {app_id.upper()}') return None def get_app_id_version_from_versions_txt(app_id):