tsk-86: Make MusicTypes and CoverArtTypes singular (#88)

Closes #86

Reviewed-on: #88
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2025-10-29 18:00:56 +00:00
committed by phoenix
parent 432078e3c2
commit b5429f80b0
6 changed files with 41 additions and 64 deletions
+6 -9
View File
@@ -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 {