Compare commits

...

2 Commits

Author SHA1 Message Date
f02793e9bd Merge branch 'coverart_changes' of git.kundeng.us:phoenix/icarus_models into coverart-remove_file 2025-10-11 16:33:05 -04:00
e3ca2c5781 Coverart save to filesystem (#67)
All checks were successful
Release Tagging / release (pull_request) Successful in 36s
Rust Build / Check (pull_request) Successful in 41s
Rust Build / Test Suite (pull_request) Successful in 43s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / Clippy (pull_request) Successful in 2m12s
Rust Build / build (pull_request) Successful in 2m18s
Reviewed-on: #67
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 20:30:39 +00:00
3 changed files with 15 additions and 3 deletions

2
Cargo.lock generated
View File

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

View File

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

View File

@@ -1,3 +1,5 @@
use std::io::Write;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
@@ -26,7 +28,17 @@ pub mod init {
}
impl CoverArt {
// TODO: Add method to save to filesystem
/// Saves the coverart to the filesystem
pub fn save_to_filesystem(&self) -> Result<(), std::io::Error> {
match std::fs::File::create(&self.path) {
Ok(mut file) => match file.write_all(&self.data) {
Ok(_) => Ok(()),
Err(err) => Err(err),
},
Err(err) => Err(err),
}
}
// TODO: Add method to remove from filesystem
}