0.1.7 upd

This commit is contained in:
Michael Wain 2025-02-14 15:30:50 +03:00
parent eac020520b
commit 7ee3539ded
3 changed files with 11 additions and 2 deletions

2
Cargo.lock generated
View File

@ -90,7 +90,7 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
[[package]]
name = "itunesdb"
version = "0.1.5"
version = "0.1.7"
dependencies = [
"bincode",
"env_logger",

View File

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

View File

@ -95,6 +95,15 @@ impl XDatabase {
}
}
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() {
return n + 1;
}
}
1
}
pub fn add_track(&mut self, track: XTrackItem) {
self.add_track_to_playlists(2, &track);
self.add_track_to_playlists(3, &track);