Skip to content

Unsave already saved songs with 's'#104

Merged
Rigellute merged 3 commits into
Rigellute:masterfrom
jfaltis:unsave-songs
Oct 27, 2019
Merged

Unsave already saved songs with 's'#104
Rigellute merged 3 commits into
Rigellute:masterfrom
jfaltis:unsave-songs

Conversation

@jfaltis
Copy link
Copy Markdown
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
Copy Markdown

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

Copy link
Copy Markdown
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

Comment thread 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
Copy Markdown
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.

Comment thread src/app.rs Outdated
}

// Currently unused but keep for future changes
#[allow(dead_code)]
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
nighi pushed a commit to nighi/spotify-tui that referenced this pull request Jul 11, 2025
Unsave already saved songs with 's'
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.

3 participants