Skip to content

Feature/enhanced lyrics support#176

Merged
theovilardo merged 4 commits intomasterfrom
feature/enhanced-lyrics-support
Oct 1, 2025
Merged

Feature/enhanced lyrics support#176
theovilardo merged 4 commits intomasterfrom
feature/enhanced-lyrics-support

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

No description provided.

google-labs-jules bot and others added 4 commits September 30, 2025 19:27
This commit introduces several enhancements to the lyrics feature:

1.  **Word-by-Word Synchronization:**
    - The UI now supports word-by-word lyric highlighting with a smooth animation.
    - Data models (`SyncedLine`, `SyncedWord`) have been updated to store word-level timestamps.

2.  **Improved LRC Parsing:**
    - The parsing logic in `LyricsUtils.kt` has been refactored and is now the centralized parser for all lyric sources.
    - It correctly handles LRC timestamps with both 2-digit (centiseconds) and 3-digit (milliseconds) precision, fixing previous synchronization issues.
    - It supports an extended LRC format for word-by-word timings.

3.  **Lyric File Import:**
    - A new option in the "Lyrics not found" dialog allows users to import local lyric files (.lrc, .txt).
    - The imported file is parsed, saved to the database, and immediately displayed.

4.  **Refactoring:**
    - Removed redundant parsing logic from `MusicRepositoryImpl.kt`, which now calls the centralized `LyricsUtils.parseLyrics` function.
    - Added `updateLyrics` to the repository layer to facilitate saving imported lyrics.
This commit introduces several enhancements to the lyrics feature:

1.  **Word-by-Word Synchronization:**
    - The UI now supports word-by-word lyric highlighting with a smooth animation.
    - Data models (`SyncedLine`, `SyncedWord`) have been updated to store word-level timestamps.

2.  **Improved LRC Parsing:**
    - The parsing logic in `LyricsUtils.kt` has been refactored and is now the centralized parser for all lyric sources.
    - It correctly handles LRC timestamps with both 2-digit (centiseconds) and 3-digit (milliseconds) precision, fixing previous synchronization issues.
    - It supports an extended LRC format for word-by-word timings.
    - When synced lyrics are parsed, a plain text version is now automatically generated to ensure UI consistency.

3.  **Lyric File Import:**
    - A new option in the "Lyrics not found" dialog allows users to import local lyric files (.lrc, .txt).
    - The imported file is parsed, saved to the database, and immediately displayed.

4.  **Refactoring & Fixes:**
    - Removed redundant parsing logic from `MusicRepositoryImpl.kt`, which now calls the centralized `LyricsUtils.parseLyrics` function.
    - Added `updateLyrics` to the repository layer to facilitate saving imported lyrics.
    - Fixed an issue where the 'Synced/Static' tabs would disappear if only synced lyrics were present.
This commit delivers a significant upgrade to the lyrics feature, addressing user feedback with the following improvements:

1.  **High-Precision Timing:**
    - The player's progress update loop in `PlayerViewModel` now runs every 40ms (down from 1000ms), enabling millisecond-level accuracy for lyric synchronization.

2.  **Bug Fixes:**
    - The `lyricsSearchUiState` is now correctly reset to `Idle` on song transitions (`onMediaItemTransition`). This fixes a critical bug where the 'Lyrics not found' dialog would fail to appear for a new song after a previous lyric operation.

3.  **Expressive Dialog Redesign:**
    - The `FetchLyricsDialog` has been completely redesigned with a custom, expressive Material 3 layout. It now features improved iconography, typography, and button styling for a more modern and intuitive user experience.

4.  **Core Lyric Enhancements (from previous commit):**
    - Full support for word-by-word synchronized lyrics, from parsing to an animated UI.
    - A robust, centralized LRC parser in `LyricsUtils` that handles various timestamp formats and generates plain text fallbacks.
    - Functionality for users to import local lyric files directly from the dialog.
This commit updates the icons used in the "Fetch Lyrics" dialog and shortens the "Import file" string to "Import".

- **Icons:**
    - Replaced `Icons.Rounded.FileUpload` with `rounded_upload_file_24.xml`.
    - Replaced `Icons.Rounded.CloudSearch` with `rounded_manage_search_24.xml`.
- **String:**
    - Changed "Import file" to "Import" in `strings.xml`.
@theovilardo theovilardo merged commit aa1177b into master Oct 1, 2025
@theovilardo theovilardo deleted the feature/enhanced-lyrics-support branch October 16, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant