feat(library): Add rating sync with file tags (FMPS_RATING standard)#15952
feat(library): Add rating sync with file tags (FMPS_RATING standard)#15952SimonDedman wants to merge 5 commits intomixxxdj:2.6from
Conversation
Adds support for saving and loading track ratings to/from file metadata tags, addressing a long-requested feature (mixxxdj#9477). ## Overview This implementation uses the FMPS_RATING standard (0.0-1.0 scale), which is compatible with Strawberry, Foobar2000, Quod Libet, and other music players. The feature is non-destructive (does not overwrite POPM/WMP ratings) and user opt-in (disabled by default). ## Changes ### TagLib Layer (Phase 1) - ID3v2: FMPS_Rating TXXX frame read/write + POPM fallback read - Xiph: FMPS_RATING Vorbis comment for FLAC/OGG - APE: FMPS_Rating item for WavPack/APE files - MP4: ----:org.freedesktop.FMPS:FMPS_Rating atom for M4A ### Preferences (Phase 2) - Two new checkboxes in Library preferences: - "Export rating to file tags" - saves Mixxx ratings to files - "Import rating from file tags" - loads ratings from files ### Integration (Phase 3-4) - MetadataSourceTagLib: importRating() and exportRating() methods - Track: Exports rating after metadata export when preference enabled - SoundSourceProxy: Imports rating during track metadata update - TrackcollectionManager: Export-on-quit now respects rating preference - RatingSyncWorker: Background sync when opening playlists/crates ## Rating Format Support | Format | Tag Type | Read | Write | |--------|----------|------|-------| | MP3 | TXXX:FMPS_Rating | ✅ | ✅ | | MP3 | POPM (fallback) | ✅ | ❌ | | FLAC/OGG | FMPS_RATING | ✅ | ✅ | | M4A | FMPS_Rating atom | ✅ | ✅ | | WavPack | FMPS_Rating (APE) | ✅ | ✅ | ## Conversion Scale | Mixxx | FMPS | Display | |-------|------|---------| | 0 | 0.0 | No rating | | 1 | 0.2 | ★ | | 2 | 0.4 | ★★ | | 3 | 0.6 | ★★★ | | 4 | 0.8 | ★★★★ | | 5 | 1.0 | ★★★★★ | Closes mixxxdj#9477 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Welcome at Mixxx! |
acolombier
left a comment
There was a problem hiding this comment.
Some high level comments before doing a more deep dived review:
- Please make sure to use smart pointer
- Use
snake_casefor new config keys - Please explain why we need a custom worker as opposed to use the same metadata runner
- We will need to have some test to ensure the supported file types are indeed well exported
|
Thanks for the review! All four items addressed in the latest push:
|
- Remove RatingSyncWorker (custom worker unnecessary; existing SoundSourceProxy pipeline handles rating import) - Rename config keys to snake_case: export_rating_to_file_tags, import_rating_from_file_tags - Add ratingexportimport_test.cpp with round-trip tests for all 8 supported formats, all rating values, clear, and no-rating cases Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
TagLib normalizes APE tag keys to uppercase on save/reload, causing the WavPack rating round-trip test to fail. Changed FMPS_Rating to FMPS_RATING in trackmetadata_ape.cpp to match this behavior (consistent with the Xiph Comment code which already used uppercase). Also fix clang-format issues: indentation in trackcollectionmanager.cpp, trailing blank lines, include ordering in metadatasourcetaglib.h, and double blank line in trackmetadata_mp4.cpp. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Break long namespace-qualified config key identifiers across lines to satisfy clang-format's line length rules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cheers for the notes Antoine. PR should be fixed now. Cheers! |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@acolombier Antoine any chance someone could have a peek at this? |
Adds support for saving and loading track ratings to/from file metadata tags, addressing a long-requested feature (#9477).
Overview
This implementation uses the FMPS_RATING standard (0.0-1.0 scale), which is compatible with Strawberry, Foobar2000, Quod Libet, and other music players that follow the freedesktop.org Media Player Specs. The feature is non-destructive (does not overwrite POPM/WMP ratings) and user opt-in (disabled by default).
Key design decisions:
Changes
TagLib Layer (Phase 1)
Rating import/export functions for all supported formats:
TXXX:FMPS_Ratingframe write, POPM fallback readFMPS_RATINGVorbis commentFMPS_Ratingitem----:org.freedesktop.FMPS:FMPS_RatingatomPreferences UI (Phase 2)
Two new checkboxes in Library preferences under "Track Metadata Synchronization":
Integration (Phase 3-4)
MetadataSourceTagLib: NewimportRating()andexportRating()virtual methodsTrack::exportMetadata(): Exports rating after metadata when preference enabledSoundSourceProxy::updateTrackFromSource(): Imports rating during track metadata updateTrackCollectionManager::exportTrackMetadataBeforeSaving(): Respects rating export preferenceRatingSyncWorker: Background worker for syncing ratings when opening playlists/cratesRating Format Support
Conversion Scale
Testing
FMPS_Rating = 1.0for 5★Screenshots
The new preferences options are located in Preferences > Library > Track Metadata Synchronization section
Test plan
FMPS_Rating = 1.0(use exiftool, kid3, or similar)Closes #9477