First model change (#23)
All checks were successful
Release Tagging / release (push) Successful in 29s
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 26s
Rust Build / Rustfmt (push) Successful in 33s
Rust Build / Clippy (push) Successful in 30s
Rust Build / build (push) Successful in 28s

Reviewed-on: #23
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
This commit is contained in:
2025-04-04 01:48:27 +00:00
committed by phoenix
parent a64d35d153
commit 61ad88a258
9 changed files with 55 additions and 42 deletions

View File

@@ -5,9 +5,7 @@ pub mod collection {
use std::fs::File;
use std::io::BufReader;
fn is_set(num: &i32) -> bool {
*num >= 0
}
use crate::init;
pub fn parse_album(filepath: &String) -> Result<Album, serde_json::Error> {
let file = File::open(filepath).expect("Failed to open file");
@@ -27,7 +25,7 @@ pub mod collection {
pub genre: String,
pub year: i32,
pub track_count: i32,
#[serde(skip_serializing_if = "is_set")]
#[serde(skip_serializing_if = "init::is_set")]
pub disc_count: i32,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub tracks: Vec<Track>,