Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v2.5.1
release_name: v2.5.1
tag_name: v2.5.2
release_name: v2.5.2
body: |
Add a total progress bar to the UI that shows the overall progress of all downloads.

Fix reversed "Download All" button behavior.

Fix a race condition that could occur when searching while downloading.

Stop downloads from completing if the user interrupts them with a search if the list is cleared.

Some additional cleanup.
Fix an issue with the download all button where it was stopping at entries without widgets.
draft: false
prerelease: false

Expand Down
19 changes: 10 additions & 9 deletions PySN.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,9 +768,15 @@ def cancel(self, dl_button, q):
q.put(ButtonAction.STOP)

#Creates directories, updates buttons, downloads the update file, and checks the hash.
def download_updates(self, url, download_path, size, sha1, index, title_id, name, console, fileloc, sem, prog_bar, status, dl_button, open_button, q):
def download_updates(self, url, download_path, size, sha1, index, title_id, name, console, fileloc, sem):
if size > 0:
with sem:
prog_bar = self.textbox.prog_bar_list[index]
status = self.textbox.status_list[index]
dl_button = self.textbox.dlbutton_list[index]
open_button = self.textbox.open_button_list[index]
q = self.textbox.queue_list[index]

def try_configure(widget, **kwargs):
try:
widget.configure(**kwargs)
Expand All @@ -792,6 +798,7 @@ def try_set(widget, val):
last_ui_update = 0
downloaded_bytes = 0
size_mb = f"{round(size / 1024000, 2)}"
cancelled = False

#send a request to the update files URL. Handle threads and download behavior based on the button state.
with self.session.get(url, stream=True, verify=False) as r:
Expand Down Expand Up @@ -895,16 +902,10 @@ def button_search(self):
self._search_thread.start()

#Behavior for the Download button.
def frame_button_download(self, game_name, title_id, url, console, update_size, sha1, index, download_path, fileloc):
prog_bar = self.textbox.prog_bar_list[index]
status = self.textbox.status_list[index]
dl_button = self.textbox.dlbutton_list[index]
open_button = self.textbox.open_button_list[index]
q = self.textbox.queue_list[index]

def frame_button_download(self, game_name, title_id, url, console, update_size, sha1, index, download_path, fileloc):
with self._download_lock:
self.total_download_size = self.total_download_size + update_size
threading.Thread(target = self.download_updates, args=(url, download_path, update_size, sha1, index, title_id, game_name, console, fileloc, self.download_semaphore, prog_bar, status, dl_button, open_button, q), daemon = True).start()
threading.Thread(target = self.download_updates, args=(url, download_path, update_size, sha1, index, title_id, game_name, console, fileloc, self.download_semaphore), daemon = True).start()

#Behavior for the Download All button. Opens the download all window.
def button_downall(self):
Expand Down
Loading