From dd79be0b48cf23624af62f6e48ec2de68e7e3cb1 Mon Sep 17 00:00:00 2001 From: yeah-its-gloria <32610623+yeah-its-gloria@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:22:51 +0200 Subject: [PATCH] Fix version lookup Checking regions was pretty superfluous anyway, since it only served to *potentially* speed up the lookup. --- NUSGet.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/NUSGet.py b/NUSGet.py index cd6f5c1..d100eff 100644 --- a/NUSGet.py +++ b/NUSGet.py @@ -400,26 +400,12 @@ class MainWindow(QMainWindow, Ui_MainWindow): if not ((title_["TID"][-2:] == "XX" and title_["TID"][:-2] == tid[:-2]) or title_["TID"] == tid): continue - region = None found_ver = False - if title_["TID"][-2:] == "XX": - global regions - for region_ in regions: - for code in regions[region_]: - if code == tid[:-2]: - region = region_ - break - - if region is None: - QMessageBox.critical(self, app.translate("MainWindow", "Script Failure"), app.translate("MainWindow", "Title #%n belongs to an unknown region.", "", index+1), buttons=QMessageBox.StandardButton.Ok, defaultButton=QMessageBox.StandardButton.Ok) - return - else: - region = "World" - - for db_version in title_["Versions"][region]: - if db_version == version: - found_ver = True - break + for region in title_["Versions"]: + for db_version in title_["Versions"][region]: + if db_version == version: + found_ver = True + break if not found_ver: QMessageBox.critical(self, app.translate("MainWindow", "Script Failure"), app.translate("MainWindow", "The version for title #%n could not be discovered in the database.", "", index+1), buttons=QMessageBox.StandardButton.Ok, defaultButton=QMessageBox.StandardButton.Ok)