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

support client protocol to "love" a track. #13

Closed
carnager opened this issue Nov 16, 2014 · 19 comments
Closed

support client protocol to "love" a track. #13

carnager opened this issue Nov 16, 2014 · 19 comments

Comments

@carnager
Copy link

mpd has this nifty feature, where other clients can request actions from other clients. The "love" flag is a perfect example, where this can be useful.
http://www.musicpd.org/doc/protocol/client_to_client.html

the love flag is documented here:
http://www.last.fm/api/show/track.love

@hrkfdn
Copy link
Owner

hrkfdn commented Nov 16, 2014

Which clients use this messaging system to broadcast that a track was 'loved' and do they follow a standard?

@carnager
Copy link
Author

right now only mpdscribble supports this feature. I dont know any C, but here is the relevant commit:
http://git.musicpd.org/cgit/master/mpdscribble.git/commit/?id=27187d3585c59f3b8a0a08b02afb49416ed876b1

no client apart from mpc uses this yet. But with mpc you can already set the love flag.

@hrkfdn
Copy link
Owner

hrkfdn commented Nov 16, 2014

Ok, thanks for explaining. It seems like an interesting concept, but maybe it is not too urgent, yet? I will definitely keep this in mind, though. Is that ok?

@rafi
Copy link

rafi commented Nov 17, 2014

The sooner the better 😉

@carnager
Copy link
Author

well, love support would be nice to have. the client protocol would just be the best way to implement this. but i would be happy for a simple mpdas --love option already :)

@hrkfdn
Copy link
Owner

hrkfdn commented Nov 18, 2014

Well, now that the demand has doubled I should certainly take a look ;)

mpdas actually used to have a mechanism to love tracks but it was removed, because the responsible Last.fm API did not work. I will probably go for the client protocol approach, but first mpdas needs some love itself. I might get this done either this week or in January. I hope that other clients will adhere to the same protocol/channel for transmitting that a track was loved.

Thanks for the input, guys.

@carnager
Copy link
Author

was this with V2 of the protocol? Just asking because V1 was missing information in api documentation. This should not be the case for V2

@hrkfdn
Copy link
Owner

hrkfdn commented Nov 18, 2014

it was with v2. i dont want to rule out an error in my implementation, but i remember reading complains from other developers about it. either way, the approach back then was overly complicated.

fyi, this is the related commit: 11ff627

@carnager
Copy link
Author

I don't know if this helps, but right now I use this to love a track:
https://github.com/morendi/lastfm-mpd-cli/blob/master/lastfm-mpd-cli#L62

@carnager
Copy link
Author

carnager commented Jan 2, 2015

btw, client protocol would also be useful to e.g. pause/unpause scrobbling.without killing the program

@hrkfdn
Copy link
Owner

hrkfdn commented Jan 20, 2015

I have just committed this functionality (loving for now), but only briefly tested it. Could you guys see if it works for you?

The channel is "mpdas", so 'mpc sendmessage mpdas love' should love the currently playing track.

@carnager
Copy link
Author

new version segfaults for me...

Program received signal SIGABRT, Aborted.
0x00007ffff70baa97 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007ffff70baa97 in raise () from /usr/lib/libc.so.6
#1 0x00007ffff70bbe6a in abort () from /usr/lib/libc.so.6
#2 0x00007ffff70fa2b3 in __libc_message () from /usr/lib/libc.so.6
#3 0x00007ffff70ff72e in malloc_printerr () from /usr/lib/libc.so.6
#4 0x00007ffff70ffeeb in _int_free () from /usr/lib/libc.so.6
#5 0x00007ffff7bcb5e6 in mpd_connection_free () from /usr/lib/libmpdclient.so.2
#6 0x0000000000406b06 in CMPD::Connect() ()
#7 0x0000000000406d40 in CMPD::CMPD() ()
#8 0x00000000004038d3 in main ()

@hrkfdn
Copy link
Owner

hrkfdn commented Jan 20, 2015

Hey,

can you try again with the latest commit? If that does not work, can you build it with debug infos by adding "-g" to CXXFLAGS and LDFLAGS and send me another backtrace?

@carnager
Copy link
Author

ok, now i cant get authentication to work... tried with both real password and md5sum of the same...
(19:26:40) [ERROR] Code: 4
(19:26:40) [ERROR] Authentication failed. Please check your login data.

@hrkfdn
Copy link
Owner

hrkfdn commented Jan 20, 2015

The authentication process hasn't been touched. Are you sure your MD5sum is correct? If you've used "echo pass | md5sum" make sure you pass -n to echo, so that the newline is not included in the hash.

@carnager
Copy link
Author

no clue what went wrong. maybe lastfm was acting on me. tried again today and it worked. including loving of a track!

@hrkfdn
Copy link
Owner

hrkfdn commented Jan 22, 2015

Glad it works! Thanks for your feedback :)

@hrkfdn hrkfdn closed this as completed Jan 22, 2015
@carnager
Copy link
Author

carnager commented Mar 9, 2015

hmm and suddenly it doesnt work anymore. it says "loved track successfully" but nothing happens. sigh

@hrkfdn
Copy link
Owner

hrkfdn commented Mar 13, 2015

just tried this myself and it worked fine, are you still affected? is your clock set up correctly?

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

No branches or pull requests

3 participants