Skip to content

Commit

Permalink
The problem of not resuming the download was fixed.
Browse files Browse the repository at this point in the history
 Changes to be committed:
	modified:   scripts/mainwindow.py
  • Loading branch information
alireza-amirsamimi committed Sep 4, 2024
1 parent 29a5319 commit 8d74e66
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions persepolis/scripts/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,7 @@ def __init__(self, start_in_tray, persepolis_main, persepolis_setting):
# download_sessions_list contains some dictionaries.
# every dictionary contains GID and session of that download process.
self.download_sessions_list = []

# queue_list_dict contains queue threads >> queue_list_dict[name of queue]
self.queue_list_dict = {}

Expand Down Expand Up @@ -1957,6 +1958,7 @@ def checkDownloadInfo(self, list):

else:
progress_window.close()

# remove item from download_sessions_list
remove_item_from_session_list_thread = RemoveItemFromSessionListThread(gid, self)
self.threadPool.append(remove_item_from_session_list_thread)
Expand Down Expand Up @@ -2677,6 +2679,14 @@ def resumeButtonPressed(self, button=None):
progress_window.activateWindow()

else:
# check if last session of this gid is finished or not!
for download_session_dict in self.download_sessions_list:
if download_session_dict['gid'] == gid:
# we already have an active tread for this download...
notifySend(QCoreApplication.translate("mainwindow_src_ui_tr", "Please retry in a minute!"),
QCoreApplication.translate("mainwindow_src_ui_tr", "be patient!"),
10000, 'warning', parent=self)
return
# get information from data_base
add_link_dictionary = self.persepolis_db.searchGidInAddLinkTable(gid)

Expand Down

0 comments on commit 8d74e66

Please sign in to comment.