tsk-86: Build fix
Some checks failed
Rust Build / Check (pull_request) Successful in 31s
Rust Build / Test Suite (pull_request) Failing after 33s
Rust Build / Rustfmt (pull_request) Successful in 30s
Rust Build / Clippy (pull_request) Successful in 34s
Rust Build / build (pull_request) Successful in 32s
Some checks failed
Rust Build / Check (pull_request) Successful in 31s
Rust Build / Test Suite (pull_request) Failing after 33s
Rust Build / Rustfmt (pull_request) Successful in 30s
Rust Build / Clippy (pull_request) Successful in 34s
Rust Build / build (pull_request) Successful in 32s
This commit is contained in:
@@ -86,20 +86,20 @@ impl CoverArt {
|
||||
|
||||
/// Generates filename for a CoverArt
|
||||
pub fn generate_filename(
|
||||
typ: crate::types::CoverArtTypes,
|
||||
typ: crate::types::CoverArtType,
|
||||
randomize: bool,
|
||||
) -> Result<String, std::io::Error> {
|
||||
let file_extension = match typ {
|
||||
crate::types::CoverArtTypes::PngExtension => {
|
||||
crate::types::CoverArtType::PngExtension => {
|
||||
String::from(crate::constants::file_extensions::image::PNGEXTENSION)
|
||||
}
|
||||
crate::types::CoverArtTypes::JpegExtension => {
|
||||
crate::types::CoverArtType::JpegExtension => {
|
||||
String::from(crate::constants::file_extensions::image::JPEGEXTENSION)
|
||||
}
|
||||
crate::types::CoverArtTypes::JpgExtension => {
|
||||
crate::types::CoverArtType::JpgExtension => {
|
||||
String::from(crate::constants::file_extensions::image::JPGEXTENSION)
|
||||
}
|
||||
crate::types::CoverArtTypes::None => {
|
||||
crate::types::CoverArtType::None => {
|
||||
return Err(std::io::Error::other("Unsupported CoverArtTypes"));
|
||||
}
|
||||
};
|
||||
|
||||
15
src/song.rs
15
src/song.rs
@@ -126,24 +126,21 @@ impl Song {
|
||||
}
|
||||
|
||||
/// Generates a filename. In order to save a song to the filesystem
|
||||
pub fn generate_filename(
|
||||
typ: types::MusicTypes,
|
||||
randomize: bool,
|
||||
) -> Result<String, std::io::Error> {
|
||||
pub fn generate_filename(typ: types::MusicType, randomize: bool) -> Result<String, std::io::Error> {
|
||||
let file_extension = match typ {
|
||||
types::MusicTypes::DefaultMusicExtension => {
|
||||
types::MusicType::DefaultMusicExtension => {
|
||||
String::from(constants::file_extensions::audio::DEFAULTMUSICEXTENSION)
|
||||
}
|
||||
types::MusicTypes::WavExtension => {
|
||||
types::MusicType::WavExtension => {
|
||||
String::from(constants::file_extensions::audio::WAVEXTENSION)
|
||||
}
|
||||
types::MusicTypes::FlacExtension => {
|
||||
types::MusicType::FlacExtension => {
|
||||
String::from(constants::file_extensions::audio::FLACEXTENSION)
|
||||
}
|
||||
types::MusicTypes::MPThreeExtension => {
|
||||
types::MusicType::MPThreeExtension => {
|
||||
String::from(constants::file_extensions::audio::MPTHREEEXTENSION)
|
||||
}
|
||||
types::MusicTypes::None => return Err(std::io::Error::other("Unsupported MusicTypes")),
|
||||
types::MusicType::None => return Err(std::io::Error::other("Unsupported MusicTypes")),
|
||||
};
|
||||
|
||||
let filename: String = if randomize {
|
||||
|
||||
Reference in New Issue
Block a user