Bug fix and minor changes release #28

Merged
phoenix merged 6 commits from devel into main 2025-06-24 23:53:21 +00:00
Showing only changes of commit 859003fc65 - Show all commits

View File

@@ -135,9 +135,11 @@ pub mod coverart {
} }
pub mod metadata { pub mod metadata {
// TODO: Move this at the end after the non-std crates
use crate::types; use crate::types;
use lofty::file::AudioFile; use lofty::file::AudioFile;
use lofty::tag::Accessor; use lofty::tag::Accessor;
use lofty::tag::TagExt;
pub fn get_meta(t: types::Type, filepath: &String) -> Result<String, std::io::Error> { pub fn get_meta(t: types::Type, filepath: &String) -> Result<String, std::io::Error> {
match std::fs::File::open(filepath) { match std::fs::File::open(filepath) {
@@ -219,7 +221,14 @@ pub mod metadata {
} }
}; };
Ok(value.to_owned()) match vb.save_to_path(filepath, lofty::config::WriteOptions::default())
{
Ok(_) => Ok(value.to_owned()),
Err(err) => Err(std::io::Error::new(
std::io::ErrorKind::InvalidData,
err.to_string(),
)),
}
} }
None => Err(std::io::Error::new( None => Err(std::io::Error::new(
std::io::ErrorKind::InvalidData, std::io::ErrorKind::InvalidData,