From cf343eab9271d35cdfc719833ffbae362a8af562 Mon Sep 17 00:00:00 2001 From: "alterwain@protonmail.com" Date: Thu, 20 Feb 2025 19:28:03 +0300 Subject: [PATCH] 0.1.59 upd --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/xobjects.rs | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52c14ef..76c0ac6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,7 +90,7 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "itunesdb" -version = "0.1.57" +version = "0.1.59" dependencies = [ "bincode", "env_logger", diff --git a/Cargo.toml b/Cargo.toml index 742f84d..6954791 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "itunesdb" -version = "0.1.58" +version = "0.1.59" edition = "2021" authors = ["alterwain"] diff --git a/src/xobjects.rs b/src/xobjects.rs index 84d4e17..d2f70cb 100644 --- a/src/xobjects.rs +++ b/src/xobjects.rs @@ -195,13 +195,19 @@ impl XDatabase { if let XSomeList::Playlists(playlists) = &mut self.find_dataset(2).child { for playlist in playlists.iter_mut() { + let mut s = playlist.elems.len(); playlist.elems.retain_mut(|t| t.0.track_id != unique_id); + s -= playlist.elems.len(); + playlist.data.playlist_item_count -= (s as u32); } } if let XSomeList::Playlists(playlists) = &mut self.find_dataset(3).child { for playlist in playlists.iter_mut() { + let mut s = playlist.elems.len(); playlist.elems.retain_mut(|t| t.0.track_id != unique_id); + s -= playlist.elems.len(); + playlist.data.playlist_item_count -= (s as u32); } } }