pull/2/head
Broque Thomas 10 months ago
parent 1283e11f30
commit ffabf9889d

@ -1 +1 @@
{"access_token": "BQAk5vVhLVv9j1H0w4esI33zLvfuC6cw2icwwe1dYmbtpcH-1nEzhsPo7-RZsoaRLvZ4uLVjBFr9b0NWpKs2JBsFq1mVCxoDckML082ogffnsKhyP3QgKdETruf04FBetm5IY1s4THMwJyK-DzDQRuHHshpakw53pLaojKMp6dR1IJN98v6I-3RBexumJgX9pvf6mn-FFURWyi-Df8iB-2UWIWR4ANLhIdTte3LqRybl5tm63aFkG7D6Rcl_XZBc", "token_type": "Bearer", "expires_in": 3600, "scope": "user-library-read user-read-private playlist-read-private playlist-read-collaborative user-read-email", "expires_at": 1753334396, "refresh_token": "AQDmfQkPCGObfJeTUIbW1hAAwhSqkuHRA3Qh2dqVYMRh0eCkFMQgPNJDDzF8y-BiaVbj80zePkK_XSfYH1aJutMtNbnsqRKWuxP31BTrMc7pdUdbE7Fma4oH8wpDUKdG3MM"}
{"access_token": "BQBcawhTowBatKdkvO7n3N80j8Pe7sZlSAoUGyWlT6Iyz-SHjUBxehwq0FomzdFUGEkJk2pQ3RKNoCY60Kvd9mDjgmh3rSFYphYE0LAEq71j1i0SR0vZnhpKV_5Ia7DdLWS3Z5em2t1XTe0dsnJoRHlvfguCDGFTGrgzOEUUtzJ6rUMqcWlgQTqWcqif0xAKij8l4hwiPI5fsWbRVQUdD-MXLqBveArU3tcJunylwDbqJfqSJ_8HxRNLDQoxtqfn", "token_type": "Bearer", "expires_in": 3600, "scope": "user-library-read user-read-private playlist-read-private playlist-read-collaborative user-read-email", "expires_at": 1753338014, "refresh_token": "AQDmfQkPCGObfJeTUIbW1hAAwhSqkuHRA3Qh2dqVYMRh0eCkFMQgPNJDDzF8y-BiaVbj80zePkK_XSfYH1aJutMtNbnsqRKWuxP31BTrMc7pdUdbE7Fma4oH8wpDUKdG3MM"}

File diff suppressed because it is too large Load Diff

@ -2972,14 +2972,42 @@ class DownloadMissingTracksModal(QDialog):
self.on_parallel_track_failed(download_index, f"No valid results after trying all {len(queries)} queries.")
def start_validated_download_parallel(self, slskd_result, spotify_metadata, track_index, table_index, download_index):
"""Start download with validated metadata - parallel version"""
"""
Start download with validated metadata. This is used for both initial downloads
and for manual retries from the 'Correct Failed Matches' modal.
"""
track_info = self.parallel_search_tracking[download_index]
# --- FIX ---
# If this track was previously marked as 'completed' (e.g., from a failure),
# we need to reset its state to allow the new download attempt to be tracked correctly.
if track_info.get('completed', False):
print(f"🔄 Resetting state for manually retried track (index: {download_index}).")
track_info['completed'] = False
# Decrement the failed count since we are retrying it.
if self.failed_downloads > 0:
self.failed_downloads -= 1
# This download is now active again. The counter was decremented when it failed,
# so we increment it here to reflect its new active status.
self.active_parallel_downloads += 1
# The 'completed_downloads' counter was incremented when the track originally failed.
# We decrement it here so the overall progress calculation remains accurate when
# this new download attempt completes.
if self.completed_downloads > 0:
self.completed_downloads -= 1
# Add the new download source to the used sources to prevent retrying with the same user/file
source_key = f"{getattr(slskd_result, 'username', 'unknown')}_{slskd_result.filename}"
track_info['used_sources'].add(source_key)
# Update UI to show the new download has been queued
spotify_based_result = self.create_spotify_based_search_result_from_validation(slskd_result, spotify_metadata)
self.track_table.setItem(table_index, 4, QTableWidgetItem("⏬ Downloading..."))
self.track_table.setItem(table_index, 4, QTableWidgetItem("... Queued"))
# Start the actual download process
self.start_matched_download_via_infrastructure_parallel(spotify_based_result, track_index, table_index, download_index)
def start_matched_download_via_infrastructure_parallel(self, spotify_based_result, track_index, table_index, download_index):
@ -3085,12 +3113,14 @@ class DownloadMissingTracksModal(QDialog):
def on_parallel_track_completed(self, download_index, success):
"""Handle completion of a parallel track download"""
track_info = self.parallel_search_tracking.get(download_index)
if not track_info or track_info['completed']: return
if not track_info or track_info.get('completed', False): return
track_info['completed'] = True
if success:
self.track_table.setItem(track_info['table_index'], 4, QTableWidgetItem("✅ Downloaded"))
self.downloaded_tracks_count += 1
# --- FIX ---
# Corrected the label update to use the incremented counter variable.
self.downloaded_count_label.setText(str(self.downloaded_tracks_count))
self.successful_downloads += 1
else:

Loading…
Cancel
Save