Compare commits

..

1 Commits

Author SHA1 Message Date
b73ffce048 tsk-50: Create functionality to extract song properties (#52)
All checks were successful
Rust Build / Check (push) Successful in 32s
Release Tagging / release (push) Successful in 36s
Rust Build / Test Suite (push) Successful in 33s
Rust Build / Clippy (push) Successful in 43s
Rust Build / Rustfmt (push) Successful in 48s
Rust Build / build (push) Successful in 36s
Closes #50

Reviewed-on: #52
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-11-06 17:31:37 +00:00
3 changed files with 23 additions and 12 deletions

2
Cargo.lock generated
View File

@@ -104,7 +104,7 @@ dependencies = [
[[package]]
name = "icarus_meta"
version = "0.4.4"
version = "0.4.5"
dependencies = [
"imghdr",
"infer",

View File

@@ -1,6 +1,6 @@
[package]
name = "icarus_meta"
version = "0.4.4"
version = "0.4.5"
edition = "2024"
rust-version = "1.90"

View File

@@ -43,8 +43,13 @@ mod tests {
match test_util::util::file_exists(&dir, &filename) {
Ok(_) => {
let filepath = test_util::util::get_full_path(&dir, &filename).unwrap();
match super::get_duration(&filepath) {
let new_filepath = test_util::util::generate_newfilepath(&dir).unwrap();
match test_util::util::copy_file(&filepath, &new_filepath) {
Ok(_) => match super::get_duration(&new_filepath) {
Ok(duration) => {
test_util::util::remove_file(&new_filepath).unwrap();
let song_duration: u64 = 41;
let fetched_song_duration = duration.as_secs();
@@ -56,6 +61,10 @@ mod tests {
Err(err) => {
assert!(false, "Error: {err:?}");
}
},
Err(err) => {
assert!(false, "Error: {err:?}");
}
}
}
Err(err) => {
@@ -75,8 +84,10 @@ mod tests {
let new_filepath = test_util::util::generate_newfilepath(&dir).unwrap();
match test_util::util::copy_file(&filepath, &new_filepath) {
Ok(_) => match super::get_song_properties(&filepath) {
Ok(_) => match super::get_song_properties(&new_filepath) {
Ok(song_properties) => {
test_util::util::remove_file(&new_filepath).unwrap();
let song_duration: u64 = 41;
let bitrate: u32 = 1;
let overall_bitrate: u32 = 3;