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

Make thumbs up/down options in the tray menu work as checkboxes #3321

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

calvin-sykes
Copy link
Contributor

This PR makes the thumbs up/down options in the system tray work like checkboxes rather than plain buttons.

So when a track is played, if it has already been rated the appropriate option in the tray will be shown checked. Changing the rating or setting one for the first time, either through the tray or through the main player window, updates the other properly (so you can unrate a track through the tray which wasn't possible before).

icon: remote.getGlobal('PlaybackAPI').data.song.albumArt,
});
window.GPM.rating.setRating(5);
if (window.GPM.rating.getRating() !== '5') {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure how this change is relevent or what it does? Can you either clarify or remove ❓

Copy link
Contributor Author

@calvin-sykes calvin-sykes Oct 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before, the "you just liked..." toast got fired every time the menu option was clicked - which was fine because once a song was already liked clicking the button again didn't do anything.
The menu option is now a toggle, so depending on whether the song is currently liked or not the rating either needs to be reset ("un-liked", as distinct from disliked) or set to 5.
Only in the latter case should the toast be shown. I didn't add an "un-liking" toast because I wasn't sure if that was the correct term to use.

(same argument in reverse applies to the dislike option)

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.

2 participants