This commit is contained in:
Broque Thomas 2025-07-25 18:25:20 -07:00
parent d607fa1ca6
commit f138824c03
3 changed files with 106 additions and 14 deletions

View file

@ -45912,3 +45912,76 @@
2025-07-25 18:22:35 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='Fearless', artist='taylor swift'
2025-07-25 18:22:35 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='Live From Clear Channel Stripped 2008', artist='taylor swift'
2025-07-25 18:22:36 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='Taylor Swift', artist='taylor swift'
2025-07-25 18:24:22 - newmusic.main - INFO - closeEvent:176 - Closing application...
2025-07-25 18:24:22 - newmusic.main - INFO - closeEvent:181 - Cleaning up Downloads page threads...
2025-07-25 18:24:22 - newmusic.main - INFO - closeEvent:186 - Stopping status monitoring thread...
2025-07-25 18:24:23 - newmusic.main - INFO - closeEvent:191 - Closing Soulseek client...
2025-07-25 18:24:23 - newmusic.main - INFO - closeEvent:197 - Application closed successfully
2025-07-25 18:24:56 - newmusic - INFO - setup_logging:57 - Logging initialized with level: DEBUG
2025-07-25 18:24:56 - newmusic.main - INFO - main:211 - Starting NewMusic application
2025-07-25 18:24:56 - newmusic.spotify_client - INFO - _setup_client:179 - Spotify client initialized (user info will be fetched when needed)
2025-07-25 18:24:56 - newmusic.soulseek_client - INFO - _setup_client:220 - Soulseek client configured with slskd at http://localhost:5030
2025-07-25 18:24:56 - newmusic.spotify_client - INFO - _setup_client:179 - Spotify client initialized (user info will be fetched when needed)
2025-07-25 18:24:57 - newmusic.spotify_client - INFO - _setup_client:179 - Spotify client initialized (user info will be fetched when needed)
2025-07-25 18:24:57 - newmusic.soulseek_client - INFO - _setup_client:220 - Soulseek client configured with slskd at http://localhost:5030
2025-07-25 18:24:57 - newmusic.main - INFO - change_page:163 - Changed to page: dashboard
2025-07-25 18:24:57 - newmusic.main - INFO - setup_media_player_connections:150 - Media player connections established between sidebar and downloads page
2025-07-25 18:24:57 - newmusic.plex_client - INFO - _find_music_library:127 - Found music library: Music
2025-07-25 18:24:57 - newmusic.plex_client - INFO - _setup_client:113 - Successfully connected to Plex server: PLEX-MACHINE
2025-07-25 18:24:58 - newmusic.main - INFO - change_page:163 - Changed to page: artists
2025-07-25 18:25:02 - newmusic.spotify_client - INFO - get_artist_albums:452 - Retrieved 30 albums for artist 06HL4z0CvFAxyc27GXpf02
2025-07-25 18:25:03 - newmusic.plex_client - INFO - _find_music_library:127 - Found music library: Music
2025-07-25 18:25:03 - newmusic.plex_client - INFO - _setup_client:113 - Successfully connected to Plex server: PLEX-MACHINE
2025-07-25 18:25:03 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='THE TORTURED POETS DEPARTMENT: THE ANTHOLOGY', artist='taylor swift'
2025-07-25 18:25:03 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='the tortured poets department the anthology', artist='taylor swift'
2025-07-25 18:25:03 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='the tortured poets department the anthology', artist=''
2025-07-25 18:25:03 - newmusic.plex_client - DEBUG - search_albums:526 - Found 2 albums matching query: album='THE TORTURED POETS DEPARTMENT', artist='taylor swift'
2025-07-25 18:25:03 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='1989 (Taylor's Version) [Deluxe]', artist='taylor swift'
2025-07-25 18:25:03 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='1989 (Taylor's Version) [Deluxe]', artist=''
2025-07-25 18:25:03 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='1989', artist='taylor swift'
2025-07-25 18:25:04 - newmusic.plex_client - DEBUG - search_albums:526 - Found 2 albums matching query: album='1989 (Taylor's Version)', artist='taylor swift'
2025-07-25 18:25:04 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='1989', artist='taylor swift'
2025-07-25 18:25:04 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='Speak Now (Taylor's Version)', artist='taylor swift'
2025-07-25 18:25:04 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='speak now', artist='taylor swift'
2025-07-25 18:25:04 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='Midnights (The Til Dawn Edition)', artist='taylor swift'
2025-07-25 18:25:04 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='midnights the til dawn edition', artist='taylor swift'
2025-07-25 18:25:04 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='midnights the til dawn edition', artist=''
2025-07-25 18:25:04 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='Midnights (3am Edition)', artist='taylor swift'
2025-07-25 18:25:04 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='midnights 3am edition', artist='taylor swift'
2025-07-25 18:25:04 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='midnights 3am edition', artist=''
2025-07-25 18:25:05 - newmusic.plex_client - DEBUG - search_albums:526 - Found 3 albums matching query: album='Midnights', artist='taylor swift'
2025-07-25 18:25:05 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='Red (Taylor's Version)', artist='taylor swift'
2025-07-25 18:25:05 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='red', artist='taylor swift'
2025-07-25 18:25:05 - newmusic.plex_client - DEBUG - search_albums:526 - Found 3 albums matching query: album='Fearless (Taylor's Version)', artist='taylor swift'
2025-07-25 18:25:05 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='fearless', artist='taylor swift'
2025-07-25 18:25:05 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='evermore (deluxe version)', artist='taylor swift'
2025-07-25 18:25:06 - newmusic.plex_client - DEBUG - search_albums:526 - Found 2 albums matching query: album='evermore', artist='taylor swift'
2025-07-25 18:25:06 - newmusic.plex_client - DEBUG - search_albums:526 - Found 2 albums matching query: album='evermore', artist='taylor swift'
2025-07-25 18:25:06 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='folklore: the long pond studio sessions (from the Disney+ special) [deluxe edition]', artist='taylor swift'
2025-07-25 18:25:06 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='folklore: the long pond studio sessions (from the Disney+ special) [deluxe edition]', artist=''
2025-07-25 18:25:06 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='folklore the long pond studio sessions from the disney special deluxe edition', artist='taylor swift'
2025-07-25 18:25:06 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='folklore the long pond studio sessions from the disney special deluxe edition', artist=''
2025-07-25 18:25:06 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='folklore (deluxe version)', artist='taylor swift'
2025-07-25 18:25:06 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='folklore', artist='taylor swift'
2025-07-25 18:25:06 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='folklore', artist='taylor swift'
2025-07-25 18:25:06 - newmusic.plex_client - DEBUG - search_albums:526 - Found 2 albums matching query: album='Lover', artist='taylor swift'
2025-07-25 18:25:07 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='Taylor Swift Karaoke: reputation', artist='taylor swift'
2025-07-25 18:25:07 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='taylor swift karaoke reputation', artist='taylor swift'
2025-07-25 18:25:07 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='taylor swift karaoke reputation', artist=''
2025-07-25 18:25:07 - newmusic.plex_client - DEBUG - search_albums:526 - Found 4 albums matching query: album='reputation', artist='taylor swift'
2025-07-25 18:25:07 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='reputation Stadium Tour Surprise Song Playlist', artist='taylor swift'
2025-07-25 18:25:07 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='1989 (Deluxe Edition)', artist='taylor swift'
2025-07-25 18:25:07 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='1989', artist='taylor swift'
2025-07-25 18:25:07 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='1989', artist='taylor swift'
2025-07-25 18:25:08 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='Red (Deluxe Edition)', artist='taylor swift'
2025-07-25 18:25:08 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='red', artist='taylor swift'
2025-07-25 18:25:08 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='Red', artist='taylor swift'
2025-07-25 18:25:08 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='Speak Now World Tour Live', artist='taylor swift'
2025-07-25 18:25:08 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='Speak Now (Deluxe Edition)', artist='taylor swift'
2025-07-25 18:25:08 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='speak now', artist='taylor swift'
2025-07-25 18:25:09 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='Speak Now', artist='taylor swift'
2025-07-25 18:25:09 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='Fearless Platinum Edition', artist='taylor swift'
2025-07-25 18:25:09 - newmusic.plex_client - DEBUG - search_albums:526 - Found 0 albums matching query: album='Fearless Platinum Edition', artist=''
2025-07-25 18:25:09 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='Fearless', artist='taylor swift'
2025-07-25 18:25:09 - newmusic.plex_client - DEBUG - search_albums:526 - Found 1 albums matching query: album='Live From Clear Channel Stripped 2008', artist='taylor swift'
2025-07-25 18:25:09 - newmusic.plex_client - DEBUG - search_albums:526 - Found 5 albums matching query: album='Taylor Swift', artist='taylor swift'

View file

@ -192,7 +192,8 @@ class AlbumSearchWorker(QThread):
class PlexLibraryWorker(QThread):
"""Background worker for checking Plex library"""
library_checked = pyqtSignal(set) # Set of owned album names
library_checked = pyqtSignal(set) # Set of owned album names (final result)
album_matched = pyqtSignal(str) # Individual album match (album name)
check_failed = pyqtSignal(str)
def __init__(self, albums, plex_client, matching_engine):
@ -284,6 +285,8 @@ class PlexLibraryWorker(QThread):
if best_match and confidence >= 0.8:
owned_albums.add(spotify_album.name)
print(f"✅ Match found: '{spotify_album.name}' -> '{best_match['title']}' (confidence: {confidence:.2f})")
# Emit individual match for real-time UI update
self.album_matched.emit(spotify_album.name)
else:
print(f"❌ No confident match for '{spotify_album.name}' (best: {confidence:.2f})")
else:
@ -1007,6 +1010,7 @@ class ArtistsPage(QWidget):
# State management
self.selected_artist = None
self.current_albums = []
self.matched_count = 0
self.artist_search_worker = None
self.album_fetch_worker = None
self.plex_library_worker = None
@ -1463,6 +1467,9 @@ class ArtistsPage(QWidget):
self.current_albums = albums
self.albums_status.setText(f"Found {len(albums)} albums • Checking Plex library...")
# Initialize match counter for real-time updates
self.matched_count = 0
# Display albums immediately (without ownership info)
self.display_albums(albums, set())
@ -1505,38 +1512,49 @@ class ArtistsPage(QWidget):
# Start new Plex worker
self.plex_library_worker = PlexLibraryWorker(albums, self.plex_client, self.matching_engine)
self.plex_library_worker.library_checked.connect(self.on_plex_library_checked)
self.plex_library_worker.album_matched.connect(self.on_album_matched)
self.plex_library_worker.check_failed.connect(self.on_plex_library_check_failed)
self.plex_library_worker.start()
def on_plex_library_checked(self, owned_albums):
"""Handle Plex library check results"""
print(f"📨 Handler started: {len(owned_albums)} owned albums")
"""Handle final Plex library check completion"""
print(f"📨 Plex check completed: {len(owned_albums)} total matches")
if not self.current_albums:
print("📨 No current albums, skipping update")
print("📨 No current albums, skipping final update")
return
# Update the status
# Update final status message
owned_count = len(owned_albums)
total_count = len(self.current_albums)
missing_count = total_count - owned_count
self.albums_status.setText(f"Found {total_count} albums • {owned_count} owned • {missing_count} available for download")
# Update existing album cards with ownership info
print(f"🔄 Updating {self.albums_grid_layout.count()} album cards")
print(f"✅ Plex check complete: {owned_count}/{total_count} albums owned")
def on_album_matched(self, album_name):
"""Handle individual album match for real-time UI update"""
print(f"🎯 Real-time match: '{album_name}'")
updated_count = 0
# Update match counter
self.matched_count += 1
# Update status text in real-time
if self.current_albums:
total_count = len(self.current_albums)
remaining_count = total_count - self.matched_count
self.albums_status.setText(f"Found {total_count} albums • {self.matched_count} owned • {remaining_count} checking...")
# Find and update the specific album card
for i in range(self.albums_grid_layout.count()):
item = self.albums_grid_layout.itemAt(i)
if item and item.widget():
album_card = item.widget()
if hasattr(album_card, 'album') and hasattr(album_card, 'update_ownership'):
is_owned = album_card.album.name in owned_albums
album_card.update_ownership(is_owned)
updated_count += 1
print(f"✅ Updated {updated_count} album cards successfully")
if hasattr(album_card, 'album') and album_card.album.name == album_name:
print(f"🔄 Real-time update: '{album_name}' -> owned")
album_card.update_ownership(True)
break
def on_plex_library_check_failed(self, error):
"""Handle Plex library check failure"""
@ -1634,6 +1652,7 @@ class ArtistsPage(QWidget):
# Clear state
self.selected_artist = None
self.current_albums = []
self.matched_count = 0
self.header_search_input.clear()
# Clear albums display