Compare commits

..

3 Commits

Author SHA1 Message Date
9b2b8af0e1 tsk-86: cargo update
Some checks failed
Rust Build / Check (pull_request) Failing after 49s
Rust Build / Test Suite (pull_request) Failing after 50s
Rust Build / Rustfmt (pull_request) Successful in 30s
Rust Build / Clippy (pull_request) Failing after 47s
Rust Build / build (pull_request) Failing after 50s
2025-10-29 13:47:52 -04:00
49ed9bbb54 tsk-86: Version bump 2025-10-29 13:47:30 -04:00
f32b2687d5 tsk-86: Make MusicTypes and CoverArtTypes singular 2025-10-29 13:47:09 -04:00
3 changed files with 15 additions and 12 deletions

View File

@@ -86,20 +86,20 @@ impl CoverArt {
/// Generates filename for a CoverArt /// Generates filename for a CoverArt
pub fn generate_filename( pub fn generate_filename(
typ: crate::types::CoverArtType, typ: crate::types::CoverArtTypes,
randomize: bool, randomize: bool,
) -> Result<String, std::io::Error> { ) -> Result<String, std::io::Error> {
let file_extension = match typ { let file_extension = match typ {
crate::types::CoverArtType::PngExtension => { crate::types::CoverArtTypes::PngExtension => {
String::from(crate::constants::file_extensions::image::PNGEXTENSION) String::from(crate::constants::file_extensions::image::PNGEXTENSION)
} }
crate::types::CoverArtType::JpegExtension => { crate::types::CoverArtTypes::JpegExtension => {
String::from(crate::constants::file_extensions::image::JPEGEXTENSION) String::from(crate::constants::file_extensions::image::JPEGEXTENSION)
} }
crate::types::CoverArtType::JpgExtension => { crate::types::CoverArtTypes::JpgExtension => {
String::from(crate::constants::file_extensions::image::JPGEXTENSION) String::from(crate::constants::file_extensions::image::JPGEXTENSION)
} }
crate::types::CoverArtType::None => { crate::types::CoverArtTypes::None => {
return Err(std::io::Error::other("Unsupported CoverArtTypes")); return Err(std::io::Error::other("Unsupported CoverArtTypes"));
} }
}; };

View File

@@ -126,21 +126,24 @@ impl Song {
} }
/// Generates a filename. In order to save a song to the filesystem /// Generates a filename. In order to save a song to the filesystem
pub fn generate_filename(typ: types::MusicType, randomize: bool) -> Result<String, std::io::Error> { pub fn generate_filename(
typ: types::MusicTypes,
randomize: bool,
) -> Result<String, std::io::Error> {
let file_extension = match typ { let file_extension = match typ {
types::MusicType::DefaultMusicExtension => { types::MusicTypes::DefaultMusicExtension => {
String::from(constants::file_extensions::audio::DEFAULTMUSICEXTENSION) String::from(constants::file_extensions::audio::DEFAULTMUSICEXTENSION)
} }
types::MusicType::WavExtension => { types::MusicTypes::WavExtension => {
String::from(constants::file_extensions::audio::WAVEXTENSION) String::from(constants::file_extensions::audio::WAVEXTENSION)
} }
types::MusicType::FlacExtension => { types::MusicTypes::FlacExtension => {
String::from(constants::file_extensions::audio::FLACEXTENSION) String::from(constants::file_extensions::audio::FLACEXTENSION)
} }
types::MusicType::MPThreeExtension => { types::MusicTypes::MPThreeExtension => {
String::from(constants::file_extensions::audio::MPTHREEEXTENSION) String::from(constants::file_extensions::audio::MPTHREEEXTENSION)
} }
types::MusicType::None => return Err(std::io::Error::other("Unsupported MusicTypes")), types::MusicTypes::None => return Err(std::io::Error::other("Unsupported MusicTypes")),
}; };
let filename: String = if randomize { let filename: String = if randomize {

View File

@@ -107,7 +107,7 @@ mod song_tests {
}; };
assert_eq!(song.directory.is_empty(), false); assert_eq!(song.directory.is_empty(), false);
match song::generate_filename(types::MusicType::FlacExtension, true) { match song::generate_filename(types::MusicTypes::FlacExtension, true) {
Ok(filename) => { Ok(filename) => {
song_cpy.filename = filename; song_cpy.filename = filename;
} }