diff --git a/database/music_database.py b/database/music_database.py index 6e4b1051..954f5869 100644 --- a/database/music_database.py +++ b/database/music_database.py @@ -1468,7 +1468,7 @@ class MusicDatabase: SELECT id, spotify_track_id, spotify_data, failure_reason, retry_count, last_attempted, date_added, source_type, source_info FROM wishlist_tracks - ORDER BY date_added ASC + ORDER BY RANDOM() """ if limit: diff --git a/ui/pages/__pycache__/downloads.cpython-312.pyc b/ui/pages/__pycache__/downloads.cpython-312.pyc index 97c86929..fcf97c1b 100644 Binary files a/ui/pages/__pycache__/downloads.cpython-312.pyc and b/ui/pages/__pycache__/downloads.cpython-312.pyc differ diff --git a/ui/pages/dashboard.py b/ui/pages/dashboard.py index 0ee781a9..84bdf3e5 100644 --- a/ui/pages/dashboard.py +++ b/ui/pages/dashboard.py @@ -3351,7 +3351,7 @@ class AutoWishlistProcessorWorker(QRunnable): quality_preference = config_manager.get_quality_preference() # Get wishlist tracks (limit to prevent overwhelming the system) - wishlist_tracks = self.wishlist_service.get_wishlist_tracks_for_download(limit=10) + wishlist_tracks = self.wishlist_service.get_wishlist_tracks_for_download(limit=25) if not wishlist_tracks: self.signals.processing_complete.emit(0, 0, 0) diff --git a/ui/pages/downloads.py b/ui/pages/downloads.py index 2e9f5ff2..6d348558 100644 --- a/ui/pages/downloads.py +++ b/ui/pages/downloads.py @@ -7493,6 +7493,46 @@ class DownloadsPage(QWidget): except Exception as e: print(f"❌ Error re-enabling album buttons: {e}") + + def _cleanup_empty_directories(self, download_path, moved_file_path): + """ + Clean up empty directories left after moving a file, ignoring hidden files. + Walks up the directory tree until it finds a non-empty folder or the root download path. + """ + import os + + try: + # Start with the directory that contained the moved file + # For you, this will be 'downloads/SomeAlbumFolder' + current_dir = os.path.dirname(moved_file_path) + + # This loop will continue as long as the directory is inside the main download path + while current_dir != download_path and current_dir.startswith(download_path): + # Check if the directory is empty, IGNORING hidden files like .DS_Store + is_empty = True + for entry in os.listdir(current_dir): + if not entry.startswith('.'): # This is the key fix + is_empty = False + break + + if is_empty: + print(f"Removing empty directory (ignoring hidden files): {current_dir}") + try: + os.rmdir(current_dir) + # After deleting, move up to the parent to check it too + current_dir = os.path.dirname(current_dir) + except OSError as e: + print(f"Warning: Could not remove directory {current_dir}: {e}") + break # Stop if we can't remove a directory + else: + # If the directory is not empty, the job is done. + print(f"Stopping cleanup at non-empty directory: {current_dir}") + break + + except Exception as e: + print(f"Warning: An error occurred during directory cleanup: {e}") + + def _organize_matched_download(self, download_item, original_file_path: str) -> Optional[str]: """Organize a matched download into the Transfer folder structure""" try: