Skip to content

feat: migrate metadata engine from id3 to lofty to support FLAC#33

Merged
RetricSu merged 6 commits into
developfrom
use-lofty
Apr 14, 2026
Merged

feat: migrate metadata engine from id3 to lofty to support FLAC#33
RetricSu merged 6 commits into
developfrom
use-lofty

Conversation

@RetricSu
Copy link
Copy Markdown
Owner

Description

This PR replaces the id3 crate with the lofty crate to provide multi-format metadata support (including FLAC, OGG, M4A, etc.). The entire tag parsing, persistence, lyrics sync, and track cover functionalities have been re-architected.

Changes:

  1. Underlying Crate Swap: Removed id3 in favor of lofty (v0.21.1) in Cargo.toml.
  2. Library Import Service: Refactored to leverage lofty::Probe for format-agnostic metadata extraction.
  3. Lyrics Abstraction: Rewrote lyrics reading and writing to use generic ItemKey::Lyrics format instead of MP3-specific [USLT] frames.
  4. Metadata & Image Editor: Overhauled MetadataEditor with generic TaggedFileExt and Accessor traits and added update_track_cover to enable replacing custom cover art.
  5. UI Layer Connection: Plumbed the update_track_cover up through PlaylistTableService, LibraryService, and AppCore to expose the capability to the front-end directly.

Closes metadata scaling requests and expands functionality beyond MP3 files.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the id3 crate with lofty for audio metadata management, expanding support to formats like FLAC, WAV, OGG, and M4A. It also adds the ability to update and embed album cover art into audio files. The review feedback highlights a potential risk in using Picture::new_unchecked without prior image data validation and suggests a performance optimization for file extension filtering during the library import process.

Comment thread src/lib/services/metadata_editor.rs Outdated
Comment thread src/lib/services/library_import.rs Outdated
@RetricSu RetricSu merged commit f6bbd5a into develop Apr 14, 2026
4 checks passed
@RetricSu RetricSu deleted the use-lofty branch April 14, 2026 02:54
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