v0.2.0 Release #20

Merged
phoenix merged 6 commits from devel into main 2025-03-30 17:21:28 +00:00
2 changed files with 24 additions and 9 deletions
Showing only changes of commit 56384fb371 - Show all commits

View File

@@ -1,5 +1,14 @@
pub const DEFAULTMUSICEXTENSION: &str = FLACEXTENSION;
pub const FLACEXTENSION: &str = ".flac";
pub const WAVEXTENSION: &str = ".wav";
pub const MPTHREEEXTENSION: &str = ".mp3";
pub const JPGEXTENSION: &str = ".jpg";
pub mod file_extensions {
pub mod audio {
pub const DEFAULTMUSICEXTENSION: &str = FLACEXTENSION;
pub const FLACEXTENSION: &str = ".flac";
pub const WAVEXTENSION: &str = ".wav";
pub const MPTHREEEXTENSION: &str = ".mp3";
}
pub mod image {
pub const JPGEXTENSION: &str = ".jpg";
pub const JPEGEXTENSION: &str = ".jpeg";
pub const PNGEXTENSION: &str = ".png";
}
}

View File

@@ -128,12 +128,18 @@ impl Song {
let file_extension = match typ {
types::MusicTypes::DefaultMusicExtension => {
String::from(constants::DEFAULTMUSICEXTENSION)
String::from(constants::file_extensions::audio::DEFAULTMUSICEXTENSION)
}
types::MusicTypes::WavExtension => String::from(constants::WAVEXTENSION),
types::MusicTypes::FlacExtension => String::from(constants::FLACEXTENSION),
types::MusicTypes::MPThreeExtension => String::from(constants::MPTHREEEXTENSION),
types::MusicTypes::WavExtension => {
String::from(constants::file_extensions::audio::WAVEXTENSION)
}
types::MusicTypes::FlacExtension => {
String::from(constants::file_extensions::audio::FLACEXTENSION)
}
types::MusicTypes::MPThreeExtension => {
String::from(constants::file_extensions::audio::MPTHREEEXTENSION)
}
};
if randomize {