Compare commits

..

4 Commits

Author SHA1 Message Date
1c1826ff32 tsk-57: Added schema to models
All checks were successful
Rust Build / Test Suite (pull_request) Successful in 36s
Release Tagging / release (pull_request) Successful in 38s
Rust Build / Check (pull_request) Successful in 49s
Rust Build / Rustfmt (pull_request) Successful in 36s
Rust Build / Clippy (pull_request) Successful in 51s
Rust Build / build (pull_request) Successful in 43s
2025-08-19 18:24:55 -04:00
57fd5c3029 tsk-57: Added time feature to utoipa 2025-08-19 18:24:26 -04:00
0950267a48 tsk-57: Added uuid feature for utoipa 2025-08-19 18:21:06 -04:00
abfec8d287 tsk-57: Adding utoipia crate for documentation
All checks were successful
Release Tagging / release (pull_request) Successful in 39s
Rust Build / Test Suite (pull_request) Successful in 57s
Rust Build / Check (pull_request) Successful in 59s
Rust Build / Rustfmt (pull_request) Successful in 29s
Rust Build / Clippy (pull_request) Successful in 36s
Rust Build / build (pull_request) Successful in 51s
2025-08-19 18:08:10 -04:00
5 changed files with 3 additions and 56 deletions

2
Cargo.lock generated
View File

@@ -142,7 +142,7 @@ checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
[[package]]
name = "icarus_models"
version = "0.5.6"
version = "0.5.5"
dependencies = [
"josekit",
"rand",

View File

@@ -1,6 +1,6 @@
[package]
name = "icarus_models"
version = "0.5.6"
version = "0.5.5"
edition = "2024"
rust-version = "1.88"
description = "models used for the icarus project"

View File

@@ -37,9 +37,6 @@ impl CoverArt {
Err(err) => Err(err),
}
}
// TODO: Add method to save to filesystem
// TODO: Add method to remove from filesystem
}
#[cfg(test)]

View File

@@ -1,4 +1,4 @@
use std::io::{Read, Write};
use std::io::Read;
use crate::constants;
use crate::init;
@@ -90,7 +90,6 @@ impl Song {
}
}
// TODO: Make this available as a function
pub fn to_data(&self) -> Result<Vec<u8>, std::io::Error> {
let path_result = self.song_path();
@@ -110,7 +109,6 @@ impl Song {
}
}
// TODO: Make this available as a function
pub fn generate_filename(&self, typ: types::MusicTypes, randomize: bool) -> String {
let mut filename: String = String::new();
let filename_len = 10;
@@ -152,19 +150,4 @@ impl Song {
filename
}
pub fn save_to_filesystem(&self) -> Result<(), std::io::Error> {
match self.song_path() {
Ok(song_path) => match std::fs::File::create(&song_path) {
Ok(mut file) => match file.write_all(&self.data) {
Ok(_res) => Ok(()),
Err(err) => Err(err),
},
Err(err) => Err(err),
},
Err(err) => Err(err),
}
}
// TODO: Add function to remove file from the filesystem
}

View File

@@ -150,39 +150,6 @@ mod song_tests {
}
}
}
#[test]
fn test_save_song_to_filesystem() {
let mut song = song::Song::default();
song.directory = utils::get_tests_directory();
song.filename = String::from("track02.flac");
match song.song_path() {
Ok(song_path) => match utils::extract_data_from_file(&song_path) {
Ok(data) => {
let copied_song = song::Song {
directory: utils::get_tests_directory(),
filename: String::from("track02-coppied.flac"),
data: data,
..Default::default()
};
match copied_song.save_to_filesystem() {
Ok(_) => {}
Err(err) => {
assert!(false, "Error: {err:?}")
}
}
}
Err(err) => {
assert!(false, "Error: {err:?}")
}
},
Err(err) => {
assert!(false, "Error: {err:?}");
}
}
}
}
#[cfg(test)]