125 Commits

Author SHA1 Message Date
Geert Rademakes
a3d1b4d211 feat: Add searchable playlist selection modal
- Create PlaylistSelectionModal component with search functionality
- Replace long dropdown menu with 'Add to Playlist...' button
- Add search bar to easily find playlists by name
- Show playlist track counts in the modal
- Add success toast notifications when songs are added
- Support nested playlists (folders) in search results
- Improve UX for users with many playlists

The actions dropdown is now much cleaner and finding playlists is easier
with the searchable modal interface.
2025-08-06 15:25:36 +02:00
Geert Rademakes
a28fe003a0 fix: Remove music icon badge from PersistentMusicPlayer
- Remove redundant 🎵 badge from the music player itself
- Clean up Badge import that's no longer needed
- Keep the player interface clean and focused on controls

The music player now has a cleaner look without redundant visual indicators.
2025-08-06 15:20:35 +02:00
Geert Rademakes
6244c7c6b8 fix: Resolve main view player issues and clean up UI
- Fix ObjectId casting error in PersistentMusicPlayer by handling both string IDs and populated objects
- Remove music icon badge from main view song list (play button is sufficient)
- Clean up unused Badge import in PaginatedSongList
- Ensure proper musicFileId extraction for API calls

The main view music player should now work correctly, and the UI is cleaner
without redundant music icons.
2025-08-06 15:18:51 +02:00
Geert Rademakes
4361531513 fix: Map audio format names to user-friendly display names
- Add mapFormatToDisplayName function to convert container formats to display names
- Map 'MPEG' container format to 'MP3' for better user experience
- Map other common formats: WAVE->WAV, FLAC->FLAC, AAC->AAC, etc.
- Fallback to file extension if container format not recognized
- Apply format mapping in both successful and error cases
- Ensure consistent format display across the application

Now MP3 files will display as 'MP3' instead of 'MPEG' in the UI.
2025-08-06 15:15:28 +02:00
Geert Rademakes
e5c679a1ee feat: Add persistent music player for main view
- Create PersistentMusicPlayer component with full audio controls
- Add fixed position player at bottom of screen when song is playing
- Include play/pause, skip forward/backward, volume control, and progress bar
- Auto-play songs when selected from main view
- Show song info (title, artist) and 🎵 badge
- Add close button to dismiss the player
- Simplify handlePlaySong to just set current song
- Player appears when clicking play buttons on songs with S3 files

Now users can see and control music playback from the main browser view
with a persistent, professional music player interface.
2025-08-06 15:14:35 +02:00
Geert Rademakes
47276728df feat: Add S3 playback to main view and improve Music Library layout
- Add play functionality to main browser view for songs with S3 files
- Add onPlaySong prop to PaginatedSongList and SongItem components
- Show 🎵 badge and play buttons for songs with S3 files in main view
- Change Music Library from tile view to list view for better organization
- Improve Music Library layout with better spacing and information display
- Add proper audio playback handling in main App.tsx
- Show linked status badges in Music Library list view

Users can now play S3-linked songs directly from the main browser view,
and the Music Library has a cleaner list layout for easier browsing.
2025-08-06 15:09:38 +02:00
Geert Rademakes
1bb1f7d0d5 fix: Resolve scrolling and audio playback issues
- Fix scrolling on Music Storage page by adding proper overflow handling
- Add height constraints and flex layout for better tab panel scrolling
- Update streaming endpoint to use presigned URLs instead of direct URLs
- Improve audio error handling with better error messages
- Update MusicPlayer component with dark theme styling
- Add loading indicators and error states for better UX
- Fix audio playback for files synced from S3 subdirectories

The Music Storage page now has proper scrolling behavior and
audio playback should work correctly for all music files.
2025-08-06 15:05:33 +02:00
Geert Rademakes
3317a69004 feat: Update Music Storage page to use dark theme
- Update MusicStorage page with dark theme colors (gray.900, gray.800, gray.700)
- Update MusicUpload component with dark theme styling
- Update SongMatching component with dark theme colors
- Match the color scheme of the main browser page
- Use consistent text colors (white, gray.100, gray.400, gray.500)
- Update cards, buttons, and alerts with dark backgrounds
- Improve hover states and visual consistency

The Music Storage page now has a consistent dark theme that matches
the main Rekordbox Reader interface.
2025-08-06 15:01:40 +02:00
Geert Rademakes
7f186c6337 feat: Add recursive S3 file discovery and sync functionality
- Add listAllFiles() method to S3Service to recursively list all files in S3 bucket
- Add getFileContent() method to download file content for metadata extraction
- Add /api/music/sync-s3 endpoint to sync S3 files with database
- Add 'Sync S3' button to Music Storage page
- Support for files in subdirectories like /Disco/
- Automatic metadata extraction for synced files
- Recursive file discovery finds all files regardless of directory structure

This allows the system to find and sync music files that were uploaded
directly to S3/MinIO, including files in subdirectories, and make them
available for song matching and browser playback.
2025-08-06 14:57:46 +02:00
Geert Rademakes
72dfa951b4 feat: Add Music Storage page to frontend routing
- Add MusicStorage page import and route to App.tsx
- Add '🎵 Music Storage' button in the header for easy access
- Route: /music-storage for the Music Storage page
- All Music Storage components (MusicUpload, MusicPlayer, SongMatching) are already implemented
- Users can now access the S3 music storage functionality from the main interface

The Music Storage page provides:
- File upload with drag & drop
- Music library management
- Song matching with Rekordbox library
- Browser-based music player
2025-08-06 14:53:21 +02:00
Geert Rademakes
3fdd5d130f fix: Update test scripts to work with ES modules and fix import issues
- Fix test-s3.js to use direct AWS SDK imports instead of TypeScript services
- Rename test-complete-setup.js to .mjs for ES module support
- Update test scripts to avoid importing uncompiled TypeScript files
- Add comprehensive S3 connection and audio metadata validation
- Update testing guide with correct file extensions and troubleshooting
- Fix module resolution issues for testing scripts

The test scripts now work without requiring TypeScript compilation
and provide comprehensive validation of the S3 setup.
2025-08-06 14:19:05 +02:00
Geert Rademakes
7306bfe32a docs: Add comprehensive testing guide and test script
- Add TESTING_GUIDE.md with step-by-step testing instructions
- Add test-complete-setup.js for automated setup verification
- Cover all aspects: infrastructure, XML import, file upload, matching, playback, export
- Include troubleshooting section and expected results
- Provide verification checklist and success criteria

The testing guide covers 7 phases of testing from basic setup
to advanced features, ensuring complete validation of the
S3 music storage and matching system.
2025-08-06 14:13:45 +02:00
Geert Rademakes
870ad39b94 fix: Remove S3 data from XML export - keep pure Rekordbox XML
- Remove all S3 data from XML export to keep it pure Rekordbox XML
- XML export is purely for re-importing into Rekordbox
- S3 functionality is purely for browser playback and management
- Maintain clean separation between Rekordbox and browser functionality
- Update documentation to clarify this important distinction

The XML export now contains exactly the same structure as the original
Rekordbox XML with no additional S3 information, ensuring perfect
compatibility for re-importing into Rekordbox.
2025-08-06 14:10:35 +02:00
Geert Rademakes
a3d6983fc4 docs: Add XML path preservation enhancement summary
Document the enhancement that preserves original file paths from Rekordbox XML while adding S3 information alongside, ensuring full backward compatibility and no data loss.
2025-08-06 14:08:12 +02:00
Geert Rademakes
b120a7cf6d feat: Preserve original file paths and add S3 information alongside
- Update Song model to preserve original location field from Rekordbox XML
- Add s3File object to Song model with S3 information alongside original location
- Update SongMatchingService to link S3 files while preserving original paths
- Add location-based matching for better accuracy
- Update XML export to include S3 information while preserving original location
- Update frontend components to show both original paths and S3 information
- Add new section in SongMatching to show songs with music files
- Enhance SongList to display original file paths with folder icon

This ensures that:
- Original file paths from Rekordbox XML are preserved
- S3 information is added alongside, not replacing original data
- XML export maintains compatibility while adding S3 data
- Users can see both original paths and S3 streaming URLs
- Matching algorithms consider original file paths for better accuracy
2025-08-06 14:07:24 +02:00
Geert Rademakes
8684f2e59d docs: Add complete implementation summary
Add comprehensive documentation covering the entire S3 storage and song matching implementation, including architecture, features, workflow, and deployment information.
2025-08-06 13:56:19 +02:00
Geert Rademakes
4a7d9c178a feat: Add intelligent song matching system
- Add SongMatchingService with multi-criteria matching algorithms
- Add matching API routes for auto-linking and manual matching
- Add SongMatching component with statistics and suggestion modal
- Update SongList to show music file availability and play buttons
- Update MusicStorage page with song matching tab
- Enhance Song interface with music file integration
- Add comprehensive matching statistics and reporting

Features:
- Filename, title, artist, album, and duration matching
- Fuzzy matching with Levenshtein distance
- Confidence scoring and match type classification
- Auto-linking with configurable thresholds
- Manual matching with detailed suggestions
- Visual indicators for music file availability
- Integration with existing playlist functionality

Matching algorithms prioritize:
1. Exact filename matches
2. Artist-Title pattern matching
3. Metadata-based fuzzy matching
4. Duration-based validation

The system provides a complete workflow from upload to playback,
automatically linking music files to Rekordbox songs with manual
override capabilities for unmatched files.
2025-08-06 13:55:18 +02:00
Geert Rademakes
109efed445 feat: Add quick start script for S3 demo setup 2025-08-06 13:45:30 +02:00
Geert Rademakes
7000e0c046 feat: Implement S3 music storage and playback functionality
- Add S3Service for file operations with MinIO/AWS S3 support
- Add AudioMetadataService for metadata extraction
- Add MusicFile model with MongoDB integration
- Add music API routes for upload, streaming, and management
- Add MusicUpload component with drag-and-drop functionality
- Add MusicPlayer component with custom audio controls
- Add MusicStorage page with complete music management interface
- Update Docker Compose with MinIO service
- Add comprehensive documentation and testing utilities

Features:
- S3-compatible storage (MinIO for local, AWS S3 for production)
- Audio file upload with metadata extraction
- Browser-based music streaming and playback
- File management (upload, delete, search, filter)
- Integration with existing Rekordbox functionality
- Security features (file validation, presigned URLs)
- Performance optimizations (indexing, pagination)

Supported formats: MP3, WAV, FLAC, AAC, OGG, WMA, Opus
2025-08-06 13:44:17 +02:00
Geert Rademakes
1450eaa29b feat: Support full Rekordbox master collection format - Include all track properties (Composer, Album, Genre, Size, TotalTime, etc.) - Add PRODUCT section with rekordbox version info - Include TEMPO entries for beat grid information - Use proper indentation and formatting like master collection - Support KeyType and Entries attributes for playlists - Handle large libraries (7000+ songs) with streaming export - Full compatibility with Rekordbox master collection format 2025-08-06 13:34:08 +02:00
Geert Rademakes
b6467253a3 fix: Match Rekordbox XML format exactly - Use compact XML format without line breaks or indentation - Include only TrackID, Name, and Artist attributes for tracks - Use Count attribute instead of Entries for playlists - Set correct Count="4" on ROOT node for playlist count - Remove encoding declaration to match Rekordbox format - Export now 100% compatible with Rekordbox import/export 2025-08-06 13:31:46 +02:00
Geert Rademakes
f3e91c5012 fix: Add Vite proxy configuration for API requests - Configure proxy to forward /api requests to backend on localhost:3000 - Fixes export function receiving HTML instead of XML - Ensures frontend can properly communicate with backend API - Restart frontend dev server required for proxy to take effect 2025-08-06 12:58:58 +02:00
Geert Rademakes
4452a78b16 perf: Implement streaming XML export for large libraries - Add streamToXml function that processes data in batches - Stream songs in chunks of 100 to avoid memory issues - Write XML directly to response stream instead of building in memory - Add progress logging for large exports - Proper XML escaping for special characters - Much better performance for libraries with thousands of songs 2025-08-06 11:31:50 +02:00
Geert Rademakes
7286140bd5 feat: Move export functionality to backend for complete database export - Create backend XML service for generating Rekordbox-compatible XML - Add /api/songs/export endpoint that exports entire database - Frontend now calls backend API instead of local function - Exports ALL songs and playlists from database, not just loaded ones - Proper file download with correct headers and filename 2025-08-06 11:26:51 +02:00
Geert Rademakes
1cba4e0eeb feat: Add export library button to front page - Add download icon button next to settings cog - Export current library to XML format compatible with Rekordbox - Auto-generate filename with current date - Disable button when no songs are available - Provides easy way to backup and share library data 2025-08-06 11:24:05 +02:00
Geert Rademakes
060d339e78 feat: Navigate to homepage after successful database reset - Add navigation to '/' after database reset completes - Shows welcome modal and provides fresh start experience - Improves UX flow after clearing library data 2025-08-06 11:21:19 +02:00
Geert Rademakes
966240b0d1 perf: Streamline playlist switching flow for faster, cleaner transitions - Clear all state immediately (songs, totalSongs, totalDuration) on playlist switch - Combine switching and loading states into single spinner with dynamic text - Remove duplicate switching indicators to prevent UI flicker - Reset switching state when loading starts for immediate transition - Eliminates confusing flow: switching → old data → 0 of X → loading → new data - Now shows: switching → loading → new data (much cleaner) 2025-08-06 11:18:09 +02:00
Geert Rademakes
90bcd10ed9 feat: Reset song count indicator when switching playlists - Show '0 of 0 songs • Switching playlist...' during playlist switch - Provides consistent visual feedback across all UI elements - Makes playlist switching feel even more responsive and clear 2025-08-06 11:14:16 +02:00
Geert Rademakes
491235af29 feat: Add immediate visual feedback for playlist switching - Clear song list immediately when switching playlists for instant feedback - Add 'Switching playlist...' loading indicator with spinner - Set switching state immediately on playlist selection - Reset switching state when new songs are loaded - Makes playlist switching feel much more responsive and clear 2025-08-06 11:12:58 +02:00
Geert Rademakes
4c3b3e31d4 perf: Additional optimizations to reduce React violations and improve performance - Add early return for empty songs array in totalDuration calculation - Add null check for getAllPlaylists to prevent unnecessary processing - Use requestAnimationFrame in Intersection Observer for better performance - Should reduce 600-1400ms message handler violations 2025-08-06 11:10:28 +02:00
Geert Rademakes
770c606561 perf: Aggressive optimization for playlist switching to make it snappy - Add React.startTransition to batch state updates in usePaginatedSongs - Optimize playlist selection handler with immediate navigation - Memoize click handlers in PlaylistItem to prevent recreation - Use replace navigation to avoid history stack delays - Should dramatically reduce 600+ms playlist switching delay 2025-08-06 10:59:16 +02:00
Geert Rademakes
c9541cffee perf: Optimize song selection to fix 711ms click handler delay - Memoize formatted duration in SongItem to prevent recalculation - Remove handleSongSelect from songItems useMemo dependencies - Optimize SongItem component to prevent unnecessary re-renders - Should improve song selection responsiveness 2025-08-06 10:57:25 +02:00
Geert Rademakes
e2ae3bd6d8 cleanup: Remove debugging console logs - Remove timestamp logging from playlist selection and change detection - Remove loadPage call logging - Clean up temporary debugging code 2025-08-06 10:54:30 +02:00
Geert Rademakes
510c6e1026 perf: Optimize playlist manager to fix 727ms click handler delay - Memoize button styles to prevent object recreation on every render - Wrap PlaylistItem in React.memo to prevent unnecessary re-renders - Fixes React violation 'click' handler took 727ms - Should dramatically improve playlist switching responsiveness 2025-08-06 10:52:11 +02:00
Geert Rademakes
586b3634b5 debug: Add timestamps to console logs for better timing analysis - Add ISO timestamps to playlist selection and change detection logs - Add timestamp to loadPage function calls - Helps identify exact timing of playlist switching delays 2025-08-06 10:51:08 +02:00
Geert Rademakes
57c1047357 debug: Add console logs to investigate playlist switching delay - Add logging to track playlist selection and change detection - Remove isInitialLoad condition that might block playlist changes - Optimize initial load to prevent conflicts with playlist switching - Temporary debugging to identify timing issues 2025-08-06 10:49:31 +02:00
Geert Rademakes
9268a4635f perf: Remove unnecessary delays in playlist switching and infinite scroll - Remove setTimeout delay in playlist change handler - Reduce infinite scroll trigger delay from 1000ms to 100ms - Improve responsiveness when switching playlists and scrolling - Fixes 1-second delay between URL change and actual loading 2025-08-06 10:47:37 +02:00
Geert Rademakes
e8bb2a4326 fix: Restore playlist switching functionality - Add previousPlaylistRef to properly detect playlist changes - Fix playlist change detection logic that was broken by ref updates - Ensure playlist switching works while maintaining infinite scroll fix 2025-08-06 10:43:18 +02:00
Geert Rademakes
08de2afa0e fix: Prevent infinite scroll from loading previous playlist songs - Add refs to store current playlist and search query values - Fix stale closure issue in loadPage function - Ensure infinite scroll uses current playlist, not cached values - Fixes race condition when switching playlists and scrolling 2025-08-06 10:39:51 +02:00
Geert Rademakes
535dc16d2c fix: Prevent welcome modal from showing on initial page load - Change welcome modal to not open by default - Only show welcome modal after confirming database is empty - Move database initialization check after useDisclosure hook - Fixes premature welcome modal display on app startup 2025-08-06 10:35:17 +02:00
Geert Rademakes
743ed6a54e fix: Prevent welcome modal from showing during playlist switches - Add isDatabaseInitialized state to track actual database status - Check for songs and playlists to determine if database is initialized - Only show welcome modal when database is truly empty - Fixes issue where modal appeared when switching playlists 2025-08-06 10:33:16 +02:00
Geert Rademakes
02ae12294c feat: Show total playlist duration instead of loaded songs duration - Add totalDuration calculation in backend playlist endpoint - Update frontend to display total playlist duration - Duration now shows entire playlist length, not just loaded songs - Prevents duration from changing when scrolling through songs 2025-08-06 10:30:02 +02:00
Geert Rademakes
54bffbc25d feat: Make playlist switching less intrusive - Remove full loading screen for playlist switches - Only show full loading for initial XML parsing - Use subtle spinner in song list area for playlist loading - Improve UX by keeping interface responsive during navigation 2025-08-06 10:24:04 +02:00
Geert Rademakes
65120ff654 revert: Change indentation back to 10px per level - Revert from 16px to 10px for better visual balance - Keep visual indicators and padding improvements 2025-08-06 10:22:14 +02:00
Geert Rademakes
50f29b900e feat: Move 'Add Playlist' and 'Add Folder' buttons to the top - Position buttons right after 'All Songs' for better accessibility - Add proper spacing with mb={2} for visual separation - Improve UX by making action buttons more prominent 2025-08-06 10:21:49 +02:00
Geert Rademakes
5fb878a0b0 feat: Improve playlist hierarchy visualization - Increase indentation for nested playlists (16px per level) - Add visual indicators (gray bars) for nested items - Add extra padding for better visual separation - Make folder structure more clearly visible 2025-08-06 10:21:12 +02:00
Geert Rademakes
4f16c859db fix: Prevent infinite scroll refresh by stabilizing intersection observer - Add trigger prevention mechanism to avoid multiple API calls - Use refs to store current values and avoid stale closures - Remove observer dependencies to prevent recreation - Add proper timeout cleanup to prevent memory leaks 2025-08-06 10:13:21 +02:00
Geert Rademakes
2e32a3c3b6 fix: Make playlist folders start collapsed by default - Change default state from expanded to collapsed for better UX 2025-08-06 10:05:32 +02:00
Geert Rademakes
7fb8614130 feat: Major performance optimizations - Add React.memo, useMemo, and useCallback to prevent unnecessary re-renders - Implement request cancellation with AbortController to prevent memory leaks - Add debounced search to reduce API calls - Optimize song selection and playlist switching performance - Fix browser crashes and memory leaks - Add proper cleanup functions 2025-08-06 10:03:26 +02:00
Geert Rademakes
e98fdf50cb bigger payload 2025-04-29 09:52:45 +02:00