From a538bcb7f57623e737a4401b1a472ed4fc788fff Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 1 Aug 2025 08:03:31 -0500 Subject: [PATCH] Signed-off-by: Matt Bruce --- musicbrainz_cleaner.py | 10 ---- quick_test_20.py | 108 ----------------------------------------- 2 files changed, 118 deletions(-) delete mode 100644 musicbrainz_cleaner.py delete mode 100644 quick_test_20.py diff --git a/musicbrainz_cleaner.py b/musicbrainz_cleaner.py deleted file mode 100644 index a2f087b..0000000 --- a/musicbrainz_cleaner.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python3 -""" -MusicBrainz Data Cleaner - Entry Point -Simple entry point that imports from the refactored src structure -""" - -from src.cli.main import main - -if __name__ == "__main__": - exit(main()) \ No newline at end of file diff --git a/quick_test_20.py b/quick_test_20.py deleted file mode 100644 index ed6e1d2..0000000 --- a/quick_test_20.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python3 -""" -Quick test script for 20 random songs -Simple single-threaded approach -""" - -import sys -import json -import time -from pathlib import Path - -# Add the src directory to the path -sys.path.insert(0, '/app') -from src.cli.main import MusicBrainzCleaner - -def main(): - print('šŸš€ Starting quick test with 20 random songs...') - - # Load songs - input_file = Path('data/songs.json') - if not input_file.exists(): - print('āŒ songs.json not found') - return - - with open(input_file, 'r') as f: - all_songs = json.load(f) - - print(f'šŸ“Š Total songs available: {len(all_songs):,}') - - # Take 20 random songs - import random - sample_songs = random.sample(all_songs, 20) - print(f'šŸŽÆ Testing 20 random songs...') - - # Initialize cleaner - cleaner = MusicBrainzCleaner() - - # Process songs - found_artists = 0 - found_recordings = 0 - failed_songs = [] - - start_time = time.time() - - for i, song in enumerate(sample_songs, 1): - print(f' [{i:2d}/20] Processing: "{song.get("artist", "Unknown")}" - "{song.get("title", "Unknown")}"') - - try: - result = cleaner.clean_song(song) - - artist_found = 'mbid' in result - recording_found = 'recording_mbid' in result - - if artist_found and recording_found: - found_artists += 1 - found_recordings += 1 - print(f' āœ… Found both artist and recording') - else: - failed_songs.append({ - 'original': song, - 'cleaned': result, - 'artist_found': artist_found, - 'recording_found': recording_found, - 'artist_name': song.get('artist', 'Unknown'), - 'title': song.get('title', 'Unknown') - }) - print(f' āŒ Artist: {artist_found}, Recording: {recording_found}') - - except Exception as e: - print(f' šŸ’„ Error: {e}') - failed_songs.append({ - 'original': song, - 'cleaned': {'error': str(e)}, - 'artist_found': False, - 'recording_found': False, - 'artist_name': song.get('artist', 'Unknown'), - 'title': song.get('title', 'Unknown'), - 'error': str(e) - }) - - end_time = time.time() - processing_time = end_time - start_time - - # Calculate success rates - artist_success_rate = found_artists / 20 * 100 - recording_success_rate = found_recordings / 20 * 100 - failed_rate = len(failed_songs) / 20 * 100 - - print(f'\nšŸ“Š Final Results:') - print(f' ā±ļø Processing time: {processing_time:.2f} seconds') - print(f' šŸš€ Speed: {20/processing_time:.1f} songs/second') - print(f' āœ… Artists found: {found_artists}/20 ({artist_success_rate:.1f}%)') - print(f' āœ… Recordings found: {found_recordings}/20 ({recording_success_rate:.1f}%)') - print(f' āŒ Failed songs: {len(failed_songs)} ({failed_rate:.1f}%)') - - # Show failed songs - if failed_songs: - print(f'\nšŸ” Failed songs:') - for i, failed in enumerate(failed_songs, 1): - print(f' [{i}] "{failed["artist_name"]}" - "{failed["title"]}"') - print(f' Artist found: {failed["artist_found"]}, Recording found: {failed["recording_found"]}') - if 'error' in failed: - print(f' Error: {failed["error"]}') - else: - print('\nšŸŽ‰ All songs processed successfully!') - -if __name__ == '__main__': - main() \ No newline at end of file