diff --git a/Cargo.toml b/Cargo.toml index e39ba11..9b9fde4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "itunesdb" -version = "0.1.61" +version = "0.1.62" edition = "2021" authors = ["alterwain"] diff --git a/src/xobjects.rs b/src/xobjects.rs index eb0ee1e..f56595f 100644 --- a/src/xobjects.rs +++ b/src/xobjects.rs @@ -317,4 +317,14 @@ impl XDatabase { 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); + } + } } \ No newline at end of file