tools

various tools I have been using throughout the years
Log | Files | Refs | README | LICENSE

commit cbb73233b5ec68da9721f42d1a80b7017f3e5168
parent d4ad7774157328bcc067545a951f6d2c00aa07b3
Author: mtmn <miro@haravara.org>
Date:   Fri, 10 Apr 2026 01:43:53 +0200

fix(virittaa): lofty-rs types in 0.23.3


Former-commit-id: d7d812f818b4c39a5f9c14a0a36c7fcb40380589
Former-commit-id: f1f84d4625a020c2a2470f9d587e15d9ee485e7d
Former-commit-id: 0e8e1e194172ed8daf0d8e2c65a6f7949a04e4f3
Diffstat:
Mvirittaa/src/file_io.rs | 14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/virittaa/src/file_io.rs b/virittaa/src/file_io.rs @@ -65,12 +65,12 @@ pub fn read_metadata(path: &Path) -> FileMetadata { if let Some(t) = tag { FileMetadata { artist: t - .get_string(&ItemKey::TrackArtist) - .or_else(|| t.get_string(&ItemKey::AlbumArtist)) + .get_string(ItemKey::TrackArtist) + .or_else(|| t.get_string(ItemKey::AlbumArtist)) .map(String::from), - album: t.get_string(&ItemKey::AlbumTitle).map(String::from), - track: t.get_string(&ItemKey::TrackTitle).map(String::from), - label: t.get_string(&ItemKey::Label).map(String::from), + album: t.get_string(ItemKey::AlbumTitle).map(String::from), + track: t.get_string(ItemKey::TrackTitle).map(String::from), + label: t.get_string(ItemKey::Label).map(String::from), } } else { FileMetadata::default() @@ -224,7 +224,9 @@ pub fn write_metadata(path: &Path, bpm: f32, key: &str) -> Result<()> { tag.insert_text(ItemKey::Bpm, bpm.round().to_string()); tag.insert_text(ItemKey::InitialKey, key.to_string()); - tag.insert_text(ItemKey::Unknown("TKEY".to_string()), key.to_string()); + if let Some(tkey) = ItemKey::from_key(tag.tag_type(), "TKEY") { + tag.insert_text(tkey, key.to_string()); + } tag.save_to_path(path, WriteOptions::default())?; Ok(())