0.1.91 upd
This commit is contained in:
parent
d37957a9a0
commit
0fca1aea5a
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "itunesdb"
|
||||
version = "0.1.90"
|
||||
version = "0.1.91"
|
||||
edition = "2021"
|
||||
authors = ["alterwain"]
|
||||
|
||||
|
@ -270,13 +270,15 @@ impl XDatabase {
|
||||
if let XSomeList::Playlists(playlists) = &mut self.find_dataset(2).child {
|
||||
res_pls = playlists.to_vec();
|
||||
}
|
||||
|
||||
/*if let XSomeList::Playlists(playlists) = &mut self.find_dataset(3).child {
|
||||
res_pls = [res_pls, playlists.to_vec()].concat();
|
||||
}*/
|
||||
|
||||
res_pls
|
||||
}
|
||||
|
||||
pub fn if_track_in_library(&mut self, dbid: u64) -> bool {
|
||||
if let XSomeList::TrackList(tracks) = &mut self.find_dataset(1).child {
|
||||
return tracks.iter().any(|t| t.data.dbid == dbid);
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
pub fn get_unique_id(&mut self) -> u32 {
|
||||
if let XSomeList::TrackList(tracks) = &mut self.find_dataset(1).child {
|
||||
@ -284,17 +286,7 @@ impl XDatabase {
|
||||
return n + 1;
|
||||
}
|
||||
}
|
||||
/*if let XSomeList::Playlists(playlists) = &mut self.find_dataset(2).child {
|
||||
for playlist in playlists {
|
||||
if playlist.data.is_master_playlist_flag != 0 {
|
||||
let a = playlist.args.iter().filter(|s| matches!(s, RawArgument(b))).last().unwrap();
|
||||
if let RawArgument(b) = a {
|
||||
return u32::from_le_bytes([b[12], b[13], b[14], b[15]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
102
|
||||
102 // this must be 102 due to generated RawArguments
|
||||
}
|
||||
|
||||
pub fn get_track(&mut self, id: u32) -> Option<XTrackItem> {
|
||||
@ -360,27 +352,6 @@ impl XDatabase {
|
||||
rebuild_quick_sort(playlist);
|
||||
self.check_albums();
|
||||
}
|
||||
|
||||
/*if let XSomeList::Playlists(playlists) = &mut self.find_dataset(n).child {
|
||||
let playlist = playlists.iter_mut().find(|t| t.data.is_master_playlist_flag != 0);
|
||||
if playlist.is_none() { return; }
|
||||
let playlist = playlist.unwrap();
|
||||
playlist.data.playlist_item_count += 1;
|
||||
|
||||
let elem = playlist.elems.last().unwrap();
|
||||
let mut pl_item = elem.0.clone();
|
||||
println!("{:#?}", pl_item);
|
||||
pl_item.track_id = track.data.unique_id;
|
||||
|
||||
pl_item.group_id = rand::random();
|
||||
let mut args = elem.1.clone();
|
||||
println!("{:#?}", args);
|
||||
if let XPlArgument::RawArgument(raw) = args.last_mut().unwrap() {
|
||||
raw[24] = pl_item.group_id as u8;
|
||||
}
|
||||
|
||||
playlist.elems.push((pl_item, args));
|
||||
}*/
|
||||
}
|
||||
|
||||
pub fn add_playlist(&mut self, playlist: XPlaylist) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user