From 004e6833ef08906135693708d00013d14ca760ee Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 17 Apr 2025 20:33:24 -0400 Subject: [PATCH] Cleanup --- src/meta.rs | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/src/meta.rs b/src/meta.rs index f77eb24..2c9443f 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -39,7 +39,6 @@ pub mod coverart { Ok(info) => { flac_file.set_picture(0, pic.clone(), info); Ok(pic.into_data()) - // Ok(Vec::new()) } Err(err) => Err(std::io::Error::new( std::io::ErrorKind::InvalidData, @@ -52,21 +51,6 @@ pub mod coverart { err.to_string(), )), } - - /* - let mut bytes: Vec = Vec::new(); - lofty::picture::Picture::from_flac_bytes(bytes, false, lofty::config::ParsingMode::BestAttempt); - flac_file.set_picture(0, picture, info); - - let pictures = flac_file.pictures(); - let res = pictures.to_vec(); - if !res.is_empty() { - let picture = &res[0]; - Ok(picture.clone().0.into_data()) - } else { - Ok(Vec::new()) - } - */ } Err(err) => Err(std::io::Error::new( std::io::ErrorKind::InvalidData, @@ -903,8 +887,6 @@ mod tests { let temp_file = tempfile::tempdir().expect("Could not create test directory"); let test_dir = String::from(temp_file.path().to_str().unwrap()); - // let test_filename = String::from("track08.flac"); - // let new_filepath = test_dir.clone() + "/" + &test_filename; match file_exists(&dir, &filename) { Ok(_) => { @@ -941,10 +923,6 @@ mod tests { let filename = util::get_filename(1); 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 test_filename = String::from("track08.flac"); - // let new_filepath = test_dir.clone() + "/" + &test_filename; let new_coverart = String::from("Sample Tracks 3 - Other one.png"); let new_cover_art_path = get_full_path(&dir, &new_coverart).unwrap(); @@ -960,28 +938,6 @@ mod tests { assert!(false, "Error: {:?}", err); } } - - /* - match coverart::get_coverart(&filepath) { - Ok(coverart) => { - let is_empty = coverart.is_empty(); - assert_eq!(is_empty, false, "Should not be empty"); - - let mut new_coverart_path: String = test_dir.clone(); - new_coverart_path += &String::from("/newcovvv.png"); - let _ = util::save_bytes_to_file(&coverart, &new_coverart_path); - let created_file = std::path::Path::new(&new_coverart_path); - assert!( - created_file.exists(), - "Error: {:?} has not been created", - new_coverart_path - ); - } - Err(err) => { - assert!(false, "Error: {:?}", err.to_string()); - } - } - */ } Err(err) => { assert!(false, "Error: File does not exist {:?}", err.to_string());