Global Random Mode and Last.fm API

Suggestions/requests/ideas for RuneAudio core features and functions

Global Random Mode and Last.fm API

Postby elangelo » 15 Dec 2014, 17:56

Hi,

Last.fm has an API which provides you with means of getting a similar track like the one that is already playing.
http://www.last.fm/api/show/track.getSimilar
I think it would be very neat to use this when global random is enabled...

Gr,S
elangelo
 
Posts: 3
Joined: 15 Dec 2014, 17:53

Re: Global Random Mode and Last.fm API

Postby ACX » 16 Dec 2014, 02:11

Probably useful only inside Last.fm, as it suggests similiar tracks available in its database, and not in your music library... so how would you use that?
User avatar
ACX
RuneAudio co-founder
 
Posts: 1692
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: Global Random Mode and Last.fm API

Postby elangelo » 16 Dec 2014, 08:07

I used to use an audio player on linux that did something like this. As far as i understood what track.getSimilar() does is give you a number (10 or limit) of tracks that are like the one you are running now. What that player did then was search your library for these songs. If it couldn't find any tracks it would either use the previous song in your queue or it would use last.fm api artist.getSimilar() and choose a random track from that artist. It worked amazingly well for quite a while and the moment you feel like the tracks are getting off track (pun intended) you would just queue a new song that you do think is similar and the player would start from there.
There must have been some logic to prevent it from queueing the same track twice but i never read the code so i'm not entirely sure.

I'm not sure how usefull this is for other ppl but it did work remarkably well for me, while i don't have that big library. I'm also not sure how far you are with Spotify integration but it might be usefull there too?

If you tell where you think it should fit into the code (the backend, not the preference setting or gui) i wouldn't mind trying to implement something myself and then you can see what you can do with the code.
elangelo
 
Posts: 3
Joined: 15 Dec 2014, 17:53

Re: Global Random Mode and Last.fm API

Postby ACX » 16 Dec 2014, 14:22

That would be a bit complicated to integrate it, but not impossible... are you a coder?
User avatar
ACX
RuneAudio co-founder
 
Posts: 1692
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: Global Random Mode and Last.fm API

Postby elangelo » 16 Dec 2014, 14:54

I am, but my experience with php is quite minimal.
elangelo
 
Posts: 3
Joined: 15 Dec 2014, 17:53

Re: Global Random Mode and Last.fm API

Postby jason_a69 » 25 May 2015, 10:54

This script here does what you need (I think!)

http://mpd.wikia.com/wiki/Hack:lastfmpdqc
jason_a69
 
Posts: 5
Joined: 15 May 2015, 17:12

Re: Global Random Mode and Last.fm API

Postby jason_a69 » 25 May 2015, 14:15

jason_a69 wrote:This script here does what you need (I think!)

http://mpd.wikia.com/wiki/Hack:lastfmpdqc


Sorry, this one, not the one above

http://mpd.wikia.com/wiki/Client:Playlistbuilder
jason_a69
 
Posts: 5
Joined: 15 May 2015, 17:12

Re: Global Random Mode and Last.fm API

Postby ACX » 25 May 2015, 16:41

jason_a69 wrote:http://mpd.wikia.com/wiki/Client:Playlistbuilder

Sorry but adding a new dependency (Ruby) just for a feature isn't a great idea... unless somebody wants to try to convert it in PHP and see how it works.
User avatar
ACX
RuneAudio co-founder
 
Posts: 1692
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: Global Random Mode and Last.fm API

Postby jason_a69 » 25 May 2015, 20:11

ACX wrote:
jason_a69 wrote:http://mpd.wikia.com/wiki/Client:Playlistbuilder

Sorry but adding a new dependency (Ruby) just for a feature isn't a great idea... unless somebody wants to try to convert it in PHP and see how it works.


I will see if I can get it going, it's just another call to ws.audioscrobbler.com with method track.getsimilar and then some local checks to see if the track returned is in mpd, if it is then add it to the playlist.

I do not know much about git and php development, I will have to do some research.
jason_a69
 
Posts: 5
Joined: 15 May 2015, 17:12

Re: Global Random Mode and Last.fm API

Postby jason_a69 » 11 Jun 2015, 11:42

jason_a69 wrote:
ACX wrote:
jason_a69 wrote:http://mpd.wikia.com/wiki/Client:Playlistbuilder

Sorry but adding a new dependency (Ruby) just for a feature isn't a great idea... unless somebody wants to try to convert it in PHP and see how it works.


I will see if I can get it going, it's just another call to ws.audioscrobbler.com with method track.getsimilar and then some local checks to see if the track returned is in mpd, if it is then add it to the playlist.

I do not know much about git and php development, I will have to do some research.


I have now coded this in PHP.

I have sent a private message to you ACX to explain what I have changed.
jason_a69
 
Posts: 5
Joined: 15 May 2015, 17:12

support RuneAudio Donate with PayPal


Return to Feature request

Who is online

Users browsing this forum: No registered users and 0 guests
cron