0.1.8 upd

This commit is contained in:
Michael Wain 2025-02-14 15:39:27 +03:00
parent 7ee3539ded
commit 58a582e797
2 changed files with 15 additions and 1 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "itunesdb"
version = "0.1.7"
version = "0.1.8"
edition = "2021"
authors = ["alterwain"]

View File

@ -95,6 +95,20 @@ impl XDatabase {
}
}
pub fn get_playlists(&mut self) -> Vec<XPlaylist> {
let mut res_pls = Vec::new();
if let XSomeList::Playlists(playlists) = &mut self.find_dataset(2).child {
res_pls = [&mut res_pls, playlists].concat();
}
if let XSomeList::Playlists(playlists) = &mut self.find_dataset(3).child {
res_pls = [&mut res_pls, playlists].concat();
}
res_pls
}
pub fn get_unique_id(&mut self) -> u32 {
if let XSomeList::TrackList(tracks) = &mut self.find_dataset(1).child {
if let Some(n) = tracks.iter().map(|t| t.data.unique_id).max() {