mirror of
https://github.com/NinjaCheetah/NUSGet.git
synced 2025-06-07 19:11:01 -04:00
Compare commits
No commits in common. "31f47f2acd9d239348f4780fbfc2b8c162680e7f" and "6660e129a87bb2aa4fb0b31009488712b1341551" have entirely different histories.
31f47f2acd
...
6660e129a8
@ -396,6 +396,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
archive_name = ""
|
archive_name = ""
|
||||||
break
|
break
|
||||||
|
print(archive_name)
|
||||||
titles.append(BatchTitleData(tid, title_version, console, archive_name))
|
titles.append(BatchTitleData(tid, title_version, console, archive_name))
|
||||||
self.lock_ui_for_download()
|
self.lock_ui_for_download()
|
||||||
worker = Worker(run_nus_download_batch, out_folder, titles, self.ui.pack_archive_chkbox.isChecked(),
|
worker = Worker(run_nus_download_batch, out_folder, titles, self.ui.pack_archive_chkbox.isChecked(),
|
||||||
|
@ -859,17 +859,5 @@
|
|||||||
},
|
},
|
||||||
"Ticket": false
|
"Ticket": false
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"Virtual Console - NES": [
|
|
||||||
{
|
|
||||||
"Name": "Super Mario Bros.",
|
|
||||||
"TID": "00010001464147XX",
|
|
||||||
"Versions": {
|
|
||||||
"USA/NTSC": [2],
|
|
||||||
"Europe/PAL": [2],
|
|
||||||
"Japan": [2]
|
|
||||||
},
|
|
||||||
"Ticket": false
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -13,26 +13,22 @@ def run_nus_download_batch(out_folder: pathlib.Path, titles: List[BatchTitleData
|
|||||||
use_local_chkbox: bool, repack_vwii_chkbox: bool, patch_ios: bool,
|
use_local_chkbox: bool, repack_vwii_chkbox: bool, patch_ios: bool,
|
||||||
progress_callback=None):
|
progress_callback=None):
|
||||||
for title in titles:
|
for title in titles:
|
||||||
if title.version == -1:
|
|
||||||
version_str = "Latest"
|
|
||||||
else:
|
|
||||||
version_str = str(title.version)
|
|
||||||
if title.console == "Wii" or title.console == "vWii":
|
if title.console == "Wii" or title.console == "vWii":
|
||||||
if title.archive_name != "":
|
if title.archive_name != "":
|
||||||
archive_name = f"{title.archive_name}-v{version_str}-{title.console}.wad"
|
archive_name = f"{title.archive_name}-v{title.version}-{title.console}.wad"
|
||||||
else:
|
else:
|
||||||
archive_name = f"{title.tid}-v{version_str}-{title.console}.wad"
|
archive_name = f"{title.tid}-v{title.version}-{title.console}.wad"
|
||||||
result = run_nus_download_wii(out_folder, title.tid, version_str, pack_wad_chkbox, keep_enc_chkbox,
|
result = run_nus_download_wii(out_folder, title.tid, str(title.version), pack_wad_chkbox, keep_enc_chkbox,
|
||||||
decrypt_contents_chkbox, wiiu_nus_chkbox, use_local_chkbox, repack_vwii_chkbox,
|
decrypt_contents_chkbox, wiiu_nus_chkbox, use_local_chkbox, repack_vwii_chkbox,
|
||||||
patch_ios, archive_name, progress_callback)
|
patch_ios, archive_name, progress_callback)
|
||||||
if result != 0:
|
if result != 0:
|
||||||
return result
|
return result
|
||||||
elif title.console == "DSi":
|
elif title.console == "DSi":
|
||||||
if title.archive_name != "":
|
if title.archive_name != "":
|
||||||
archive_name = f"{title.archive_name}-v{version_str}-{title.console}.tad"
|
archive_name = f"{title.archive_name}-v{title.version}-{title.console}.tad"
|
||||||
else:
|
else:
|
||||||
archive_name = f"{title.tid}-v{version_str}-{title.console}.tad"
|
archive_name = f"{title.tid}-v{title.version}-{title.console}.tad"
|
||||||
result = run_nus_download_dsi(out_folder, title.tid, version_str, pack_wad_chkbox, keep_enc_chkbox,
|
result = run_nus_download_dsi(out_folder, title.tid, str(title.version), pack_wad_chkbox, keep_enc_chkbox,
|
||||||
decrypt_contents_chkbox, use_local_chkbox, archive_name, progress_callback)
|
decrypt_contents_chkbox, use_local_chkbox, archive_name, progress_callback)
|
||||||
if result != 0:
|
if result != 0:
|
||||||
return result
|
return result
|
||||||
|
@ -99,8 +99,6 @@ def run_nus_download_dsi(out_folder: pathlib.Path, tid: str, version: str, pack_
|
|||||||
# Use a typed TAD name if there is one, and auto generate one based on the TID and version if there isn't.
|
# Use a typed TAD name if there is one, and auto generate one based on the TID and version if there isn't.
|
||||||
progress_callback.emit("Packing TAD...")
|
progress_callback.emit("Packing TAD...")
|
||||||
if tad_file_name != "" and tad_file_name is not None:
|
if tad_file_name != "" and tad_file_name is not None:
|
||||||
# Batch downloads may insert -vLatest, so if it did we can fill in the real number now.
|
|
||||||
tad_file_name = tad_file_name.replace("-vLatest", f"-v{title_version}")
|
|
||||||
if tad_file_name[-4:].lower() != ".tad":
|
if tad_file_name[-4:].lower() != ".tad":
|
||||||
tad_file_name += ".tad"
|
tad_file_name += ".tad"
|
||||||
else:
|
else:
|
||||||
@ -114,3 +112,15 @@ def run_nus_download_dsi(out_folder: pathlib.Path, tid: str, version: str, pack_
|
|||||||
if (not pack_tad_enabled and pack_tad_chkbox) or (not decrypt_contents_enabled and decrypt_contents_chkbox):
|
if (not pack_tad_enabled and pack_tad_chkbox) or (not decrypt_contents_enabled and decrypt_contents_chkbox):
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
def run_nus_download_dsi_batch(out_folder: pathlib.Path, titles: List[Tuple[str, str, str]], pack_tad_chkbox: bool,
|
||||||
|
keep_enc_chkbox: bool, decrypt_contents_chkbox: bool, use_local_chkbox: bool,
|
||||||
|
progress_callback=None):
|
||||||
|
for title in titles:
|
||||||
|
result = run_nus_download_dsi(out_folder, title[0], title[1], pack_tad_chkbox, keep_enc_chkbox,
|
||||||
|
decrypt_contents_chkbox, use_local_chkbox, f"{title[2]}-{title[1]}.tad",
|
||||||
|
progress_callback)
|
||||||
|
if result != 0:
|
||||||
|
return result
|
||||||
|
progress_callback.emit(f"Batch download finished.")
|
||||||
|
return 0
|
||||||
|
@ -116,8 +116,6 @@ def run_nus_download_wii(out_folder: pathlib.Path, tid: str, version: str, pack_
|
|||||||
# Use a typed WAD name if there is one, and auto generate one based on the TID and version if there isn't.
|
# Use a typed WAD name if there is one, and auto generate one based on the TID and version if there isn't.
|
||||||
progress_callback.emit(" - Packing WAD...")
|
progress_callback.emit(" - Packing WAD...")
|
||||||
if wad_file_name != "" and wad_file_name is not None:
|
if wad_file_name != "" and wad_file_name is not None:
|
||||||
# Batch downloads may insert -vLatest, so if it did we can fill in the real number now.
|
|
||||||
wad_file_name = wad_file_name.replace("-vLatest", f"-v{title_version}")
|
|
||||||
if wad_file_name[-4:].lower() != ".wad":
|
if wad_file_name[-4:].lower() != ".wad":
|
||||||
wad_file_name += ".wad"
|
wad_file_name += ".wad"
|
||||||
else:
|
else:
|
||||||
@ -142,3 +140,16 @@ def run_nus_download_wii(out_folder: pathlib.Path, tid: str, version: str, pack_
|
|||||||
if (not pack_wad_enabled and pack_wad_chkbox) or (not decrypt_contents_enabled and decrypt_contents_chkbox):
|
if (not pack_wad_enabled and pack_wad_chkbox) or (not decrypt_contents_enabled and decrypt_contents_chkbox):
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
def run_nus_download_wii_batch(out_folder: pathlib.Path, titles: List[Tuple[str, str, str]], pack_wad_chkbox: bool,
|
||||||
|
keep_enc_chkbox: bool, decrypt_contents_chkbox: bool, wiiu_nus_chkbox: bool,
|
||||||
|
use_local_chkbox: bool, repack_vwii_chkbox: bool, patch_ios: bool,
|
||||||
|
progress_callback=None):
|
||||||
|
for title in titles:
|
||||||
|
result = run_nus_download_wii(out_folder, title[0], title[1], pack_wad_chkbox, keep_enc_chkbox,
|
||||||
|
decrypt_contents_chkbox, wiiu_nus_chkbox, use_local_chkbox, repack_vwii_chkbox,
|
||||||
|
patch_ios, f"{title[2]}-{title[1]}.wad", progress_callback)
|
||||||
|
if result != 0:
|
||||||
|
return result
|
||||||
|
progress_callback.emit(f"Batch download finished.")
|
||||||
|
return 0
|
||||||
|
@ -11,7 +11,7 @@ class TreeItem:
|
|||||||
self.data = data
|
self.data = data
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.children = []
|
self.children = []
|
||||||
self.metadata = metadata
|
self.metadata = metadata # Store hidden metadata
|
||||||
|
|
||||||
def add_child(self, item):
|
def add_child(self, item):
|
||||||
self.children.append(item)
|
self.children.append(item)
|
||||||
@ -53,16 +53,14 @@ class NUSGetTreeModel(QAbstractItemModel):
|
|||||||
name = entry.get("Name")
|
name = entry.get("Name")
|
||||||
versions = entry.get("Versions", {})
|
versions = entry.get("Versions", {})
|
||||||
if tid:
|
if tid:
|
||||||
tid_item = TreeItem([f"{tid} - {name}", ""], key_item, entry.get("Ticket"))
|
tid_item = TreeItem([f"{tid} - {name}", ""], key_item)
|
||||||
key_item.add_child(tid_item)
|
key_item.add_child(tid_item)
|
||||||
for region, version_list in versions.items():
|
for region, version_list in versions.items():
|
||||||
region_item = TreeItem([region, ""], tid_item)
|
region_item = TreeItem([region, ""], tid_item)
|
||||||
tid_item.add_child(region_item)
|
tid_item.add_child(region_item)
|
||||||
for version in version_list:
|
for version in version_list:
|
||||||
danger = entry.get("Danger") if entry.get("Danger") is not None else ""
|
danger = entry.get("Danger") if entry.get("Danger") is not None else ""
|
||||||
archive_name = (entry.get("Archive Name") if entry.get("Archive Name") is not None
|
metadata = TitleData(entry.get("TID"), entry.get("Name"), entry.get("Archive Name"),
|
||||||
else entry.get("Name").replace(" ", "-"))
|
|
||||||
metadata = TitleData(entry.get("TID"), entry.get("Name"), archive_name,
|
|
||||||
version, entry.get("Ticket"), region, key, danger)
|
version, entry.get("Ticket"), region, key, danger)
|
||||||
public_versions = entry.get("Public Versions")
|
public_versions = entry.get("Public Versions")
|
||||||
if public_versions is not None:
|
if public_versions is not None:
|
||||||
@ -98,11 +96,12 @@ class NUSGetTreeModel(QAbstractItemModel):
|
|||||||
|
|
||||||
if role == Qt.DecorationRole and index.column() == 0:
|
if role == Qt.DecorationRole and index.column() == 0:
|
||||||
# Check for icons based on the "Ticket" metadata only at the TID level
|
# Check for icons based on the "Ticket" metadata only at the TID level
|
||||||
if item.metadata is not None and isinstance(item.metadata, bool):
|
if item.parent and item.parent.data_at(0) == "System":
|
||||||
if item.metadata is True:
|
if item.metadata and "Ticket" in item.metadata:
|
||||||
return QIcon.fromTheme("dialog-ok")
|
if item.metadata["Ticket"]:
|
||||||
|
return QIcon.fromTheme("dialog-ok") # Checkmark icon
|
||||||
else:
|
else:
|
||||||
return QIcon.fromTheme("dialog-cancel")
|
return QIcon.fromTheme("dialog-cancel") # X icon
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def headerData(self, section, orientation, role=Qt.DisplayRole):
|
def headerData(self, section, orientation, role=Qt.DisplayRole):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user