Coverart save to filesystem #67

Merged
phoenix merged 4 commits from coverart_save_to_fs into coverart_changes 2025-10-11 20:30:39 +00:00
Showing only changes of commit 5143b03e1a - Show all commits

View File

@@ -2,7 +2,6 @@ use std::io::Write;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
pub struct CoverArt {
pub id: uuid::Uuid,
@@ -32,19 +31,11 @@ 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)
}
Ok(mut file) => match file.write_all(&self.data) {
Ok(_) => Ok(()),
Err(err) => Err(err),
},
Err(err) => Err(err),
}
}