Compare commits

..

1 Commits

Author SHA1 Message Date
290db5ce10 Wanring fix 2025-10-11 16:32:13 -04:00
4 changed files with 5 additions and 32 deletions

2
Cargo.lock generated
View File

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

View File

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

View File

@@ -1,5 +1,3 @@
use std::io::Write;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
@@ -28,31 +26,8 @@ pub mod init {
}
impl CoverArt {
/// 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),
}
}
/// Removes the coverart from the filesystem
pub fn remove_from_filesystem(&self) -> Result<(), std::io::Error> {
let p = std::path::Path::new(&self.path);
if p.exists() {
match std::fs::remove_file(p) {
Ok(_) => Ok(()),
Err(err) => Err(err),
}
} else {
Err(std::io::Error::other(
"Cannot delete file that does not exist",
))
}
}
// TODO: Add method to save to filesystem
// TODO: Add method to remove from filesystem
}
pub mod io {

View File

@@ -118,9 +118,7 @@ impl Song {
Err(err) => Err(err),
}
} else {
Err(std::io::Error::other(
"Cannot delete file that does not exist",
))
Ok(())
}
}
Err(err) => Err(err),