0.1.93 upd
This commit is contained in:
parent
db366cfba3
commit
f0cbffe692
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "itunesdb"
|
||||
version = "0.1.92"
|
||||
version = "0.1.93"
|
||||
edition = "2021"
|
||||
authors = ["alterwain"]
|
||||
|
||||
|
@ -231,15 +231,6 @@ impl XDatabase {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn remove_track(&mut self, unique_id: u32, playlist_id: u64) {
|
||||
@ -252,16 +243,6 @@ impl XDatabase {
|
||||
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() {
|
||||
if playlist.data.persistent_playlist_id != playlist_id { continue }
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_playlists(&mut self) -> Vec<XPlaylist> {
|
||||
@ -365,19 +346,11 @@ impl XDatabase {
|
||||
if let XSomeList::Playlists(playlists) = &mut self.find_dataset(2).child {
|
||||
playlists.push(playlist.clone());
|
||||
}
|
||||
|
||||
if let XSomeList::Playlists(playlists) = &mut self.find_dataset(3).child {
|
||||
playlists.push(playlist);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn remove_playlist(&mut self, pl_id: u64) {
|
||||
if let XSomeList::Playlists(playlists) = &mut self.find_dataset(2).child {
|
||||
playlists.retain_mut(|p| p.data.persistent_playlist_id != pl_id);
|
||||
}
|
||||
|
||||
if let XSomeList::Playlists(playlists) = &mut self.find_dataset(3).child {
|
||||
playlists.retain_mut(|p| p.data.persistent_playlist_id != pl_id);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user