diff --git a/src/main.rs b/src/main.rs index 6525da0..6c5023a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,6 +40,7 @@ struct CliArgs { value_parser(["title", "artist", "album"]) )] search_field: Option, + // Add flag for "search filepaths too" } fn main() { @@ -78,6 +79,8 @@ fn main() { socket.write_message(Message::Text(message_string)).unwrap(); let msg = socket.read_message().expect("Error reading message"); - println!("Received: {}", msg); + let resp: message_types::ServerResponse = + serde_json::from_str(msg.into_text().unwrap().as_str()).unwrap(); + println!("recieved: {:?}", resp); socket.close(None).unwrap(); } diff --git a/src/message_types.rs b/src/message_types.rs index d68cb8c..1c8fea5 100644 --- a/src/message_types.rs +++ b/src/message_types.rs @@ -18,7 +18,7 @@ impl Default for ItemTag { artist: String::new(), album: String::new(), album_artist: String::new(), - } + } } } @@ -73,7 +73,7 @@ impl PartialTag { } } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug)] pub struct ServerResponse { pub search_results: Vec, }