Compare commits
2 Commits
fb7332e9ca
...
v0.8.3
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a27b8ccb1 | |||
| afc4ca21a2 |
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -149,7 +149,7 @@ checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"
|
||||
|
||||
[[package]]
|
||||
name = "icarus_models"
|
||||
version = "0.8.2"
|
||||
version = "0.8.3"
|
||||
dependencies = [
|
||||
"josekit",
|
||||
"rand",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "icarus_models"
|
||||
version = "0.8.2"
|
||||
version = "0.8.3"
|
||||
edition = "2024"
|
||||
rust-version = "1.90"
|
||||
description = "models used for the icarus project"
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
A library containing commonly used models and functions that is used throughout
|
||||
icarus projects. This reduces the amount of duplicated code without a benefit.
|
||||
A library containing commonly used structs, functions, enums, constants and other code
|
||||
that is used throughout the icarus projects. Code from this library serves as the model
|
||||
for other projects in the icarus project.
|
||||
|
||||
@@ -80,7 +80,7 @@ impl CoverArt {
|
||||
let directory = &self.directory;
|
||||
let last_index = directory.len() - 1;
|
||||
|
||||
match crate::util::concatenate_path(&directory, &self.filename, last_index) {
|
||||
match crate::util::concatenate_path(directory, &self.filename, last_index) {
|
||||
Ok(path) => Ok(path),
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
@@ -102,7 +102,7 @@ pub fn generate_filename(typ: crate::types::CoverArtTypes, randomize: bool) -> S
|
||||
};
|
||||
|
||||
if randomize {
|
||||
let mut filename: String = String::new();
|
||||
let mut filename: String = String::from("coverart-");
|
||||
let some_chars: String = String::from("abcdefghij0123456789");
|
||||
let some_chars_length = some_chars.len();
|
||||
let mut rng = rand::rng();
|
||||
@@ -117,7 +117,7 @@ pub fn generate_filename(typ: crate::types::CoverArtTypes, randomize: bool) -> S
|
||||
}
|
||||
filename + &file_extension
|
||||
} else {
|
||||
"track-output".to_string() + &file_extension
|
||||
"coverart-output".to_string() + &file_extension
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ impl Song {
|
||||
let directory = &self.directory;
|
||||
let last_index = directory.len() - 1;
|
||||
|
||||
match crate::util::concatenate_path(&directory, &self.filename, last_index) {
|
||||
match crate::util::concatenate_path(directory, &self.filename, last_index) {
|
||||
Ok(path) => Ok(path),
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
@@ -143,12 +143,13 @@ pub fn generate_filename(typ: types::MusicTypes, randomize: bool) -> String {
|
||||
};
|
||||
|
||||
if randomize {
|
||||
let mut filename: String = String::new();
|
||||
let mut filename: String = String::from("track-");
|
||||
let some_chars: String = String::from("abcdefghij0123456789");
|
||||
let some_chars_length = some_chars.len();
|
||||
let mut rng = rand::rng();
|
||||
|
||||
for _ in 0..FILENAME_LENGTH {
|
||||
let index = rng.random_range(0..=19);
|
||||
let index = rng.random_range(0..=some_chars_length);
|
||||
let rando_char = some_chars.chars().nth(index);
|
||||
|
||||
if let Some(c) = rando_char {
|
||||
|
||||
Reference in New Issue
Block a user