From d37957a9a0b66577dadf3b305b02c72f1ca50a62 Mon Sep 17 00:00:00 2001 From: "alterwain@protonmail.com" Date: Sat, 22 Feb 2025 03:06:05 +0300 Subject: [PATCH] 0.1.90 upd --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/artworkdb.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cab4b26..7b3845f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,7 +90,7 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "itunesdb" -version = "0.1.88" +version = "0.1.90" dependencies = [ "bincode", "env_logger", diff --git a/Cargo.toml b/Cargo.toml index e6cdcca..893b378 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "itunesdb" -version = "0.1.89" +version = "0.1.90" edition = "2021" authors = ["alterwain"] diff --git a/src/artworkdb.rs b/src/artworkdb.rs index 1405f05..5119181 100644 --- a/src/artworkdb.rs +++ b/src/artworkdb.rs @@ -233,7 +233,7 @@ pub mod aobjects { self.children.iter_mut().find(|d| d.data.data_type == p0).unwrap() } - pub fn add_images(&mut self, song_dbid: u64, song_unique: u32) -> (String, String) { + pub fn add_images(&mut self, song_dbid: u64, cover_hash: u64) -> (String, String) { let ds = self.find_dataset(1); let image_items = &mut ds.child; let new_id = image_items.last().map_or(100, |p| p.data.as_ref().unwrap().id + 1); @@ -278,7 +278,7 @@ pub mod aobjects { unk2: 0, }, str: Some( - [":F", &format!("{:X}", song_unique) ,".ithmb"].concat(), + [":", &format!("{:X}", cover_hash) ,".ithmb"].concat(), ), } ), @@ -315,7 +315,7 @@ pub mod aobjects { unk2: 0, }, str: Some( - [":F", &format!("{:X}", song_unique) ,"_1.ithmb"].concat(), + [":", &format!("{:X}", cover_hash) ,"_1.ithmb"].concat(), ), } ), @@ -357,7 +357,7 @@ pub mod aobjects { }, ]); self.data.as_mut().unwrap().next_id_for_mhii = new_id + 1; - (["F", &format!("{:X}", song_unique) ,".ithmb"].concat(), ["F", &format!("{:X}", song_unique) ,"_1.ithmb"].concat()) + ([&format!("{:X}", cover_hash) ,".ithmb"].concat(), [&format!("{:X}", cover_hash) ,"_1.ithmb"].concat()) } }