Compare commits

..

1 Commits

Author SHA1 Message Date
phoenix 2b2e96c02d Merge pull request 'devel' (#16) from devel into main
Reviewed-on: phoenix/icarus-models#16
2025-03-22 21:24:15 +00:00
3 changed files with 10 additions and 25 deletions
+5 -14
View File
@@ -1,14 +1,5 @@
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";
}
}
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";
+1 -1
View File
@@ -2,7 +2,7 @@ use std::io::Read;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct CoverArt {
pub id: i32,
pub title: String,
+4 -10
View File
@@ -128,18 +128,12 @@ impl Song {
let file_extension = match typ {
types::MusicTypes::DefaultMusicExtension => {
String::from(constants::file_extensions::audio::DEFAULTMUSICEXTENSION)
String::from(constants::DEFAULTMUSICEXTENSION)
}
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)
}
types::MusicTypes::WavExtension => String::from(constants::WAVEXTENSION),
types::MusicTypes::FlacExtension => String::from(constants::FLACEXTENSION),
types::MusicTypes::MPThreeExtension => String::from(constants::MPTHREEEXTENSION),
};
if randomize {