workflow_fix #12

Merged
phoenix merged 23 commits from workflow_fix into devel 2025-04-12 18:37:03 +00:00
Showing only changes of commit faafbf5202 - Show all commits

View File

@@ -38,6 +38,46 @@ mod meta {
}
}
mod meta_nouveaou {
use super::*;
use metadata;
pub fn get_meta(t: meta_type::Type, filepath: &String) -> Result<String, std::io::Error> {
match t {
meta_type::Type::Title => match new_meta(&filepath) {
Ok(metaa) => {
let mut result = String::new();
for item in metaa.tags {
result += &String::from(" ");
result += &item.0;
result += &item.1;
}
Ok(result)
}
Err(err) => Err(err),
},
/*
meta_type::Type::Title
meta_type::Type::Title
meta_type::Type::Title
meta_type::Type::Title
*/
_ => Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
"Invalid",
)),
}
}
fn new_meta(filepath: &String) -> Result<metadata::MediaFileMetadata, std::io::Error> {
let path = std::path::Path::new(&filepath);
metadata::MediaFileMetadata::new(&path)
}
}
#[cfg(test)]
mod tests {
use super::*;
@@ -52,5 +92,16 @@ mod tests {
println!("Path: {:?}", full_path);
assert!(full_path.exists(), "Path does not exists {:?}", full_path);
let filepath = full_path.display().to_string();
match meta_nouveaou::get_meta(meta_type::Type::Title, &filepath) {
Ok(_title) => {
let found = _title.contains("Just");
assert!(found, "Meta information was not found");
}
Err(err) => {
assert!(false, "Error: {:?}", err);
}
}
}
}