summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/serve.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/serve.rs b/src/serve.rs
index 7c15b03..bc13b86 100644
--- a/src/serve.rs
+++ b/src/serve.rs
@@ -34,6 +34,9 @@ pub fn get_tracks(name: String, url: String) -> String {
)
.unwrap();
let uid = get_uid(user_id.as_ref(), &mut client);
+ client
+ .execute("DELETE FROM user_track WHERE user_id = $1;", &[&uid])
+ .unwrap();
drop(client);
let chunk_size = 50;
let mut playlist_index = 0;
@@ -184,10 +187,11 @@ pub fn match_users(name1: String, name2: String) -> Result<String, status::Custo
let tid: i32 = row.get(0);
let song = &client
.query(
- "SELECT name artist popularity FROM track where track_id = $1",
+ "SELECT name, artist FROM track where track_id = $1",
&[&tid],
)
.unwrap()[0];
+ println!("{:?}", song.columns());
let name: String = song.get(0);
let artist: String = song.get(1);
songs = format!("{}{} by {}\n", songs, name, artist);