From 5fd47b445e1e6c83f0f9873d4378976901eedbac Mon Sep 17 00:00:00 2001 From: KeksNino Date: Thu, 3 Sep 2026 20:50:10 +0200 Subject: [PATCH] feat: add file name indicator at the top of the editor buffer --- src/edit.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/edit.rs b/src/edit.rs index 42e814f..a33573a 100644 --- a/src/edit.rs +++ b/src/edit.rs @@ -1,5 +1,4 @@ use lofty::config::WriteOptions; -use lofty::prelude::ItemKey::AlbumTitle; use lofty::tag::TagItem; use lofty::tag::TagType::VorbisComments; use lofty::tag::{ItemKey, ItemValue}; @@ -14,6 +13,11 @@ pub fn edit(file_path: PathBuf, mut tag: Tag) -> std::io::Result<()> { let tmp_file = PathBuf::from("/tmp/keks-sort-metadata"); let editor = var("EDITOR").unwrap(); let mut file = File::create(&tmp_file)?; + writeln!( + file.try_clone()?, + "------------ {:?} ------------", + file_path + )?; for item in tag.items() { writeln!( file, @@ -35,7 +39,8 @@ pub fn edit(file_path: PathBuf, mut tag: Tag) -> std::io::Result<()> { let parsed = parse(&editable); for (key, value) in parsed { - let item_key = ItemKey::from_key(VorbisComments, &key).expect("Failed to get item key"); + let item_key = + ItemKey::from_key(VorbisComments, &key).expect("ERROR: Failed to get item key"); let item = TagItem::new(item_key, ItemValue::Text(value)); tag.insert(item.clone()); }