0.1.10 upd
This commit is contained in:
parent
20d6b6d9a9
commit
f4d38a7937
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "itunesdb"
|
name = "itunesdb"
|
||||||
version = "0.1.9"
|
version = "0.1.10"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["alterwain"]
|
authors = ["alterwain"]
|
||||||
|
|
||||||
|
@ -72,6 +72,39 @@ pub enum XSomeList {
|
|||||||
AlbumList(Vec<XAlbumItem>)
|
AlbumList(Vec<XAlbumItem>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl XPlaylist {
|
||||||
|
pub fn set_title(&mut self, title: String) {
|
||||||
|
self.update_arg(1, title);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_title(&self) -> String {
|
||||||
|
self.get_arg(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_arg(&self, id: u32) -> String {
|
||||||
|
for arg in self.args {
|
||||||
|
if let XPlArgument::String(val) = arg {
|
||||||
|
if val.arg_type == id {
|
||||||
|
return val.val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String::new()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn update_arg(&mut self, id: u32, val: String) {
|
||||||
|
self.args.retain_mut(|t| {
|
||||||
|
if let XPlArgument::String(s) = t {
|
||||||
|
if s.arg_type == id {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
self.args.push(XPlArgument::String(XArgument { arg_type: id, val }));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl XTrackItem {
|
impl XTrackItem {
|
||||||
pub fn set_location(&mut self, location: String) {
|
pub fn set_location(&mut self, location: String) {
|
||||||
self.update_arg(2, location);
|
self.update_arg(2, location);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user