Moved to_data (#66)
Some checks failed
Rust Build / Check (pull_request) Successful in 33s
Release Tagging / release (pull_request) Successful in 36s
Rust Build / Test Suite (pull_request) Successful in 45s
Rust Build / Rustfmt (pull_request) Successful in 33s
Rust Build / Clippy (pull_request) Failing after 44s
Rust Build / build (pull_request) Successful in 1m7s
Some checks failed
Rust Build / Check (pull_request) Successful in 33s
Release Tagging / release (pull_request) Successful in 36s
Rust Build / Test Suite (pull_request) Successful in 45s
Rust Build / Rustfmt (pull_request) Successful in 33s
Rust Build / Clippy (pull_request) Failing after 44s
Rust Build / build (pull_request) Successful in 1m7s
Reviewed-on: #66 Co-authored-by: phoenix <kundeng00@pm.me> Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -142,7 +142,7 @@ checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
|
||||
|
||||
[[package]]
|
||||
name = "icarus_models"
|
||||
version = "0.6.3"
|
||||
version = "0.6.4"
|
||||
dependencies = [
|
||||
"josekit",
|
||||
"rand",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "icarus_models"
|
||||
version = "0.6.3"
|
||||
version = "0.6.4"
|
||||
edition = "2024"
|
||||
rust-version = "1.88"
|
||||
description = "models used for the icarus project"
|
||||
|
@@ -1,5 +1,3 @@
|
||||
use std::io::Read;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
|
||||
@@ -28,8 +26,16 @@ pub mod init {
|
||||
}
|
||||
|
||||
impl CoverArt {
|
||||
pub fn to_data(&self) -> Result<Vec<u8>, std::io::Error> {
|
||||
let path: &String = &self.path;
|
||||
// TODO: Add method to save to filesystem
|
||||
// TODO: Add method to remove from filesystem
|
||||
}
|
||||
|
||||
pub mod io {
|
||||
use std::io::Read;
|
||||
|
||||
/// Gets the raw data of the cover art
|
||||
pub fn to_data(coverart: &super::CoverArt) -> Result<Vec<u8>, std::io::Error> {
|
||||
let path: &String = &coverart.path;
|
||||
let mut file = std::fs::File::open(path)?;
|
||||
let mut buffer = Vec::new();
|
||||
match file.read_to_end(&mut buffer) {
|
||||
@@ -37,9 +43,6 @@ impl CoverArt {
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Add method to save to filesystem
|
||||
// TODO: Add method to remove from filesystem
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
Reference in New Issue
Block a user