-
-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsave already saved songs with 's' #104
Conversation
Does it make sense to add a confirmation prompt for this potentially destructive action? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Another great contribution @jfaltis. Just left some comments, once addressed I'll approve
src/app.rs
Outdated
if let Some(spotify) = &self.spotify { | ||
match spotify.current_user_saved_tracks_contains(&[track_id.clone()]) { | ||
Ok(saved) => { | ||
if saved[0] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably overkill, but to be safe let's use saved.first()
instead of the array accessor [0]
. We'd then need to handle the option.
src/app.rs
Outdated
} | ||
|
||
// Currently unused but keep for future changes | ||
#[allow(dead_code)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you able to delete this? No need to allow dead code (shouldn't exist in master).
@alichtman that's an interesting point - let's see how it goes without a prompt. The official Spotify client doesn't throw up a prompt when removing saved tracks, so let's copy that behaviour for now. |
@Rigellute I adressed your changes. I also agree that we don't need to confirm this action since it can be made undone very easily |
Pressing s now toggles the saved state of a song, which allows unsaving songs. Kept the old save_tracks despite it not being used for usage in future changes.