commit 3b237fd1f8835a1757287f837d2ff093ca141e00 from: mtmn date: Thu May 7 10:59:57 2026 UTC fix: print track title in read mode commit - c51290f55aa0b4113b8b69cd06059ff9b539d44a commit + 3b237fd1f8835a1757287f837d2ff093ca141e00 blob - ad2f0e02618e8907d78c9cdca35c47ea8e61ab88 blob + a2aa5005fdd3974774b35e37c4c1920aece40e7b --- src/tagging.rs +++ src/tagging.rs @@ -109,22 +109,23 @@ pub fn show_file_tags(path: &Path) -> Result<()> { let (tagged_file, artist, album) = read_file_tags(&abs_path)?; - println!("{artist} - {album}"); - let tag = tagged_file.primary_tag().context("No primary tag found")?; + let title = tag + .title() + .map_or_else(|| "Unknown".to_string(), |t| t.to_string()); + let genre = tag + .get(ItemKey::Genre) + .and_then(|i| i.value().text()) + .unwrap_or("(none)"); + let label = tag + .get(ItemKey::Label) + .and_then(|i| i.value().text()) + .unwrap_or("(none)"); - if let Some(genre_item) = tag.get(ItemKey::Genre) - && let Some(genre) = genre_item.value().text() - { - println!(" Genre: {genre}"); - } + println!("{artist} - {album} - {title}"); + println!(" Genre: {genre}"); + println!(" Label: {label}"); - if let Some(label_item) = tag.get(ItemKey::Label) - && let Some(label) = label_item.value().text() - { - println!(" Label: {label}"); - } - Ok(()) }