Merged
Conversation
This commit addresses an issue where the "Date Added" sorting option for songs was not functioning as expected. The previous implementation relied on inconsistent file metadata. The new implementation introduces an app-managed `dateAdded` timestamp to the `Song` entity. The `SyncWorker` has been refactored to use a robust "clear and insert" strategy that correctly preserves historical data. When synchronizing: - It fetches all existing songs from the local database to preserve their original `dateAdded` timestamps and lyrics. - For new songs found in MediaStore, it assigns a uniform timestamp for the entire batch. This ensures that all songs from the initial library scan share the same timestamp, as requested. The `PlayerViewModel` now handles sorting client-side, using the new `dateAdded` field. This approach is simpler and avoids the race conditions and bugs encountered in previous attempts to implement repository-level sorting.
This commit resolves an issue where the "Date Added" sorting option for songs was unreliable because it depended on file system metadata. The new implementation introduces an app-managed `dateAdded` timestamp to the `Song` entity. This ensures a consistent and predictable sort order based on when a song is first imported into the app's library. Key changes: - Added a `dateAdded` column to the `songs` table. - Implemented a Room migration (`MIGRATION_6_7`) to safely apply this schema change for existing users, preventing crashes on app updates. - Refactored the `SyncWorker` to use a robust "clear and insert" strategy that correctly preserves historical data. When synchronizing: - It fetches all existing songs from the local database to preserve their original `dateAdded` timestamps and lyrics. - For new songs found in MediaStore, it assigns a uniform timestamp for the entire batch. This ensures that all songs from the initial library scan share the same timestamp. - The `PlayerViewModel` now handles sorting client-side, using the new `dateAdded` field. This approach is simpler and avoids race conditions encountered in previous attempts to implement repository-level sorting.
This commit refactors the `LyricsSheet` component to enhance its visual consistency and text presentation. The key changes include: - Applying the `onBackgroundColor` to the `title` and `MoreVert` icon to ensure they adapt correctly to the current theme. - Setting the `fontFamily` to `GoogleSansRounded` and `fontWeight` to `Bold` for the lyrics provider titles (`DropdownMenuItem`), improving readability and aligning with the app's typography.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.