Add list feature
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -33,6 +33,14 @@ async fn main() {
|
||||
Err(e) => eprintln!("{e}"),
|
||||
}
|
||||
} else {
|
||||
// Check if the parameter is -l
|
||||
if username == "-l" {
|
||||
db.get_user_most_ratings()
|
||||
.await
|
||||
.expect("Could not get ratings");
|
||||
return;
|
||||
}
|
||||
|
||||
let user_id = db.add_user(&username).await.expect("Could not add user");
|
||||
println!("UserID for {username}: {user_id}");
|
||||
}
|
||||
@@ -45,7 +53,7 @@ async fn main() {
|
||||
.expect("Could not read from database");
|
||||
|
||||
if is_empty {
|
||||
println!("Add an user first. This can be achieved by using rate_music [name] [user_id]");
|
||||
println!("Add a new user first. This can be achieved by using rate_music [name] [user_id]");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user