From 31838794b10cf77d0424ff83977765a67e0ea7b2 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 20 Jun 2025 20:30:43 -0400 Subject: [PATCH] Fixing bug --- src/meta.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/meta.rs b/src/meta.rs index c73da04..1687ab8 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -138,6 +138,7 @@ pub mod metadata { use crate::types; use lofty::file::AudioFile; use lofty::tag::Accessor; + use lofty::tag::TagExt; pub fn get_meta(t: types::Type, filepath: &String) -> Result { match std::fs::File::open(filepath) { @@ -219,6 +220,8 @@ pub mod metadata { } }; + vb.save_to_path(filepath, lofty::config::WriteOptions::default()); + Ok(value.to_owned()) } None => Err(std::io::Error::new( @@ -579,7 +582,8 @@ mod tests { let dir = String::from(util::TESTFILEDIRECTORY); let temp_file = tempfile::tempdir().expect("Could not create test directory"); - let test_dir = String::from(temp_file.path().to_str().unwrap()); + let mut test_dir = String::from(temp_file.path().to_str().unwrap()); + test_dir = String::from("/home/phoenix/tmp/songparser/mydata"); let test_filename = String::from("track08.flac"); let new_filepath = test_dir + "/" + &test_filename;