Skip to content
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

Merged
merged 3 commits into from
Oct 27, 2019
Merged

Conversation

jfaltis
Copy link
Contributor

@jfaltis jfaltis commented Oct 24, 2019

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.

@alichtman
Copy link

Does it make sense to add a confirmation prompt for this potentially destructive action?

Copy link
Owner

@Rigellute Rigellute left a 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] {
Copy link
Owner

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)]
Copy link
Owner

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).

@Rigellute
Copy link
Owner

@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.

@jfaltis
Copy link
Contributor Author

jfaltis commented Oct 25, 2019

@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

@Rigellute Rigellute merged commit 229c4b8 into Rigellute:master Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants