0.1.19 upd

This commit is contained in:
Michael Wain 2025-02-15 17:20:17 +03:00
parent bdc06ca565
commit e1e8d0a12c
3 changed files with 13 additions and 3 deletions

2
Cargo.lock generated
View File

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

View File

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

View File

@ -256,7 +256,7 @@ impl XDatabase {
let mut pl_item = elem.0.clone();
pl_item.track_id = track.data.unique_id;
pl_item.group_id = rand::thread_rng().gen_range(10..255);
pl_item.group_id = rand::random();
let mut args = elem.1.clone();
if let XPlArgument::RawArgument(raw) = args.last_mut().unwrap() {
raw[24] = pl_item.group_id as u8;
@ -265,4 +265,14 @@ impl XDatabase {
playlist.elems.push((pl_item, args));
}
}
pub fn add_playlist(&mut self, playlist: XPlaylist) {
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);
}
}
}