better
This commit is contained in:
parent
1e280f9211
commit
5a67a808fd
5 changed files with 1592 additions and 1 deletions
|
|
@ -1 +1 @@
|
|||
{"access_token": "BQAWKVNNtomCKGa7Uqjf0jVEQL6QhxZjNNR7R_q5J0TUWlMHm7uFhxFTr_tkZx9OUgZK26871FBtB7vTDIvB2w0DsRyva7IW50NZOACzjAqGtwhVHffNydcScBLGEqswd0Iw1DhTVy1QOILDXPU106HwnedIRoBduxlDSfVhVdp5QbOS4svQAzZcHrf3xEvvSr7C_KK4SKMSDjBSl_mKgqhCmkJt0vk79F3lh-TUOI5K1S_hUMxVXro-6vLj2Mh4", "token_type": "Bearer", "expires_in": 3600, "scope": "user-library-read user-read-private playlist-read-private playlist-read-collaborative user-read-email", "expires_at": 1752613801, "refresh_token": "AQDmfQkPCGObfJeTUIbW1hAAwhSqkuHRA3Qh2dqVYMRh0eCkFMQgPNJDDzF8y-BiaVbj80zePkK_XSfYH1aJutMtNbnsqRKWuxP31BTrMc7pdUdbE7Fma4oH8wpDUKdG3MM"}
|
||||
{"access_token": "BQA46b0RlEdvS0gRj7PaBXvXHPWy0toM2vJeP4trcib5KSm7puoZAs-uTn5Bjqe1v8SZ8cMPGugxho1LE0yyHhmWs3x7eoNGlDshBLhKfT5bC-Yj6TK5WWAjYxsF1EPiHRgVVWu7jB9IoN2vFkR3xD6BvMvwQnxBhfFI8LrTFLEuXk-xwK3X8R9-_ctDOa5h1tAemIAj2GKtR3FJu1PpLXKWiGYpWj97V-aXfZELF9XjFhZ0MBbuNo4LCRBjZf4b", "token_type": "Bearer", "expires_in": 3600, "scope": "user-library-read user-read-private playlist-read-private playlist-read-collaborative user-read-email", "expires_at": 1752618762, "refresh_token": "AQDmfQkPCGObfJeTUIbW1hAAwhSqkuHRA3Qh2dqVYMRh0eCkFMQgPNJDDzF8y-BiaVbj80zePkK_XSfYH1aJutMtNbnsqRKWuxP31BTrMc7pdUdbE7Fma4oH8wpDUKdG3MM"}
|
||||
1543
logs/app.log
1543
logs/app.log
File diff suppressed because it is too large
Load diff
Binary file not shown.
Binary file not shown.
|
|
@ -7,6 +7,7 @@ from PyQt6.QtGui import QFont, QPainter, QPen, QColor, QPixmap
|
|||
from PyQt6.QtMultimedia import QMediaPlayer, QAudioOutput
|
||||
import functools # For fixing lambda memory leaks
|
||||
import os
|
||||
import threading
|
||||
|
||||
# Import the new search result classes
|
||||
from core.soulseek_client import TrackResult, AlbumResult
|
||||
|
|
@ -3303,8 +3304,27 @@ class DownloadItem(QFrame):
|
|||
self.file_path = file_path
|
||||
self.download_id = download_id # Track download ID for cancellation
|
||||
self.soulseek_client = soulseek_client # For cancellation functionality
|
||||
|
||||
# Add completion tracking to prevent duplicate processing
|
||||
self._completion_processed = False
|
||||
self._completion_lock = threading.Lock()
|
||||
|
||||
self.setup_ui()
|
||||
|
||||
def mark_completion_processed(self) -> bool:
|
||||
"""Thread-safe method to mark download as completion-processed.
|
||||
Returns True if this is the first time marking completion, False if already processed."""
|
||||
with self._completion_lock:
|
||||
if self._completion_processed:
|
||||
return False # Already processed
|
||||
self._completion_processed = True
|
||||
return True # First time processing
|
||||
|
||||
def is_completion_processed(self) -> bool:
|
||||
"""Check if completion has already been processed."""
|
||||
with self._completion_lock:
|
||||
return self._completion_processed
|
||||
|
||||
def setup_ui(self):
|
||||
self.setFixedHeight(85) # More generous height for better spacing
|
||||
self.setStyleSheet("""
|
||||
|
|
@ -3716,8 +3736,26 @@ class CompactDownloadItem(QFrame):
|
|||
self.album = album
|
||||
self.track_number = track_number
|
||||
|
||||
# Add completion tracking to prevent duplicate processing
|
||||
self._completion_processed = False
|
||||
self._completion_lock = threading.Lock()
|
||||
|
||||
self.setup_ui()
|
||||
|
||||
def mark_completion_processed(self) -> bool:
|
||||
"""Thread-safe method to mark download as completion-processed.
|
||||
Returns True if this is the first time marking completion, False if already processed."""
|
||||
with self._completion_lock:
|
||||
if self._completion_processed:
|
||||
return False # Already processed
|
||||
self._completion_processed = True
|
||||
return True # First time processing
|
||||
|
||||
def is_completion_processed(self) -> bool:
|
||||
"""Check if completion has already been processed."""
|
||||
with self._completion_lock:
|
||||
return self._completion_processed
|
||||
|
||||
def setup_ui(self):
|
||||
self.setMinimumHeight(70) # Increased minimum to accommodate text properly
|
||||
self.setMaximumHeight(120) # Increased maximum for long track titles
|
||||
|
|
@ -8993,6 +9031,11 @@ class DownloadsPage(QWidget):
|
|||
# Check if this is a matched download and process accordingly
|
||||
print(f"🔍 Checking download item '{download_item.title}' for matched artist...")
|
||||
if hasattr(download_item, 'matched_artist') and download_item.matched_artist:
|
||||
# CRITICAL FIX: Check if completion was already processed to prevent duplicates
|
||||
if hasattr(download_item, 'mark_completion_processed') and not download_item.mark_completion_processed():
|
||||
print(f"⚠️ Completion already processed for '{download_item.title}' - skipping to prevent duplicates")
|
||||
continue
|
||||
|
||||
print(f"🎯 Queuing background processing for matched download: '{download_item.title}' by '{download_item.matched_artist.name}'")
|
||||
|
||||
# Create background worker to handle the heavy processing
|
||||
|
|
@ -9017,6 +9060,11 @@ class DownloadsPage(QWidget):
|
|||
print(f" ⚠️ matched_artist is None or empty")
|
||||
else:
|
||||
print(f" ❌ No matched_artist attribute found")
|
||||
|
||||
# Check if completion was already processed (for consistency)
|
||||
if hasattr(download_item, 'mark_completion_processed') and not download_item.mark_completion_processed():
|
||||
print(f"⚠️ Normal download completion already processed for '{download_item.title}' - skipping")
|
||||
continue
|
||||
|
||||
# Update the download item status and progress for normal downloads
|
||||
download_item.update_status(
|
||||
|
|
|
|||
Loading…
Reference in a new issue