hechtus / squeezebox-googlemusic

Squeezebox (Logitech Media Server) Plugin for Google Play Music
103 stars 24 forks source link

Add ability to rate songs #33

Closed elfez closed 9 years ago

elfez commented 10 years ago

Having an equivalent to Thumbs Up/Down would be nice. For ease of use possibly add a menu as the first item in the song context menu, with a radio button for Like/Dislike/unrated or equivalent. Skipping to next track on dislike would be a nice bonus too.

gdhgdhgdh commented 10 years ago

Yep this would be great - I like the Radio support, and having a 'Thumbs Down' would really improve the feature - if Google decides to play a turkey, I want to be able to say "Google, no. Just no." Auto-skip to next track would be a necessity.

hechtus commented 10 years ago

I agree. When I'm having some time I will have a look.

hechtus commented 10 years ago

It seems that there is the Mobileclient change_song_metadata() method that allows to change the user rating. I could at least easily add context menu entries for like and dislike for songs currently playing or in the current playlist. When I'm talking about the context menu I mean the menu that already has this "On Google Music" entry. Any further comments ideas are welcome.

gdhgdhgdh commented 10 years ago

That sounds good.

Does the SqueezeServer allow additional UI elements such as a 'thumbs up' / 'thumbs down' icon beside the 'Heart', 'Play', 'Plus' icons on the context menu, or would this need to be a pair of text lines such as 'Like this track' and 'Dislike this track' ?

hechtus commented 10 years ago

I don't expect that thumbs up/down icons can easily being added to the Web UI. Have you ever seen another plugin that is doing something similar? Is there a plugin that possibly has some like/dislike functionality I could adapt?

gdhgdhgdh commented 10 years ago

Hey Ronald,

I've not used other plugins of this style before and I think you're right that the inherent inflexibility of the web UI will dictate the necessity to use text links. Ultimately the functionality is more important than the accessibility.

elfez commented 10 years ago

In an ideal world I'd like to see this as the very first item when going to a track's sub-menu (where "Save to Favourites" is now), but I presume butting into the main menus might be awkward.

Given that I'd propose the submenu goes under "On Google Music", at the top, in a menu of its own, with three states: Like, dislike and undefined (or can a radio button be toggled on and off individually? The "Shuffle" menu would indicate not).

I'm trying to figure out how the code works, so I'll see if I can make any headway on this (though perl makes my eyes bleed :)

hechtus commented 10 years ago

If you would like to do it, I suggest to do it the same way like "on Google music". I would register two additional submenus. One for like and one for dislike on Google music.

hechtus commented 10 years ago

I was working on this today and got a reasonable solution. Unfortunately it doesn't work finally, because the Mobileclient API does not return the current track rating value. This is related to issue simon-weber/Unofficial-Google-Music-API/issues/182.

@simon-weber: Any idea how to resolve this? Do you need any help?

hechtus commented 10 years ago

Finally I found out that the rating information is NOT returned by mc.get_track_info(), BUT by mc.search_all_access() AND mc.get_album_info(). This is not a bug introduced by gmusicapi, but by Google Music itself.

@elfez: Do you want to help how the Mobileclients get the rating information? You already did a great job of finding out how "I'm feeling lucky radio" works.

elfez commented 10 years ago

I can certainly take a look, though I'm a touch busy at the moment, so it may be a while before I get round to looking.

hechtus commented 10 years ago

If anyone wants to try this out. I've pushed a solution to the v0.4 branch You could download a snapshot from here and copy the GoogleMusic directory to your installation path.

https://github.com/hechtus/squeezebox-googlemusic/archive/v0.4.zip

Any feedback is highly appreciated.

gdhgdhgdh commented 10 years ago

I hoped to try this over the weekend, but the weather was too pleasant. In reality the SmartMix support has left this feature out in the cold as a second class citizen. :(

hechtus commented 10 years ago

The (radio) auto-skip function is not implemented yet. This could be something that has to be configured through the preferences.

hechtus commented 9 years ago

Done in v0.4.0