Updated api_parser and song model
This commit is contained in:
@@ -7,14 +7,28 @@ pub struct APIParser {
|
||||
}
|
||||
|
||||
impl APIParser {
|
||||
// pub fn init() -> APIParser {
|
||||
// }
|
||||
|
||||
pub fn retrieve_api(&self) -> models::api::API {
|
||||
return models::api::API::default();
|
||||
return self.api;
|
||||
}
|
||||
|
||||
// TODO: Implement
|
||||
fn parse_api(&self) {
|
||||
pub fn parse_api(&self) {
|
||||
let flags = self.ica_act.flags;
|
||||
println!("Parsing api");
|
||||
|
||||
for (i, elem) in flags {
|
||||
let arg = elem.flag;
|
||||
let value = elem.value;
|
||||
|
||||
if arg == "-h" {
|
||||
if value.chars().nth((value.len() - 1)) == '/' {
|
||||
self.api.url = value;
|
||||
} else {
|
||||
self.api.url = value + "/";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
self.api.version = "v1";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user