Fixing bug

This commit is contained in:
2025-06-20 20:30:43 -04:00
parent 000639b0f8
commit 31838794b1

View File

@@ -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<String, std::io::Error> {
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;