Compare commits
1 Commits
v0.1.30-de
...
v0.1.30-de
Author | SHA1 | Date | |
---|---|---|---|
859003fc65 |
11
src/meta.rs
11
src/meta.rs
@@ -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,
|
||||||
|
Reference in New Issue
Block a user