[RELEASE] Last.FM Playlist Generator Script - Auto Generate Similar Music Playlists

  Thread Rating:
  • 4 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
ErlendSB Offline
Senior Member
Posts: 187
Joined: Sep 2008
Reputation: 3
Location: Norway
Post: #46
Thanks mate!
Yes. I am aware of it. But i haven't figured out a good way to fix it yet. It can be done by adding some code to autoexec.py for deleting the .pid file. It's something you'd have to do yourself, as the autoexec.py file is outside the realm of the addon.
I can't remember where I saw the code, but I'll post it if I find it again.
find quote
DarkHelmet Offline
Fan
Posts: 344
Joined: Jul 2008
Reputation: 0
Location: Hamburg, Germany
Post: #47
How does the script pick a song, that is on more that one album? I have several tracks that are on a studio album and on one or more live albums. It seems like the script always picks that song from the same album. Would it be possible to randomize that somehow?

It's no big deal though, I was just wondering.

Have you found an answer as to why the generated list somehow seems to stem from the files section and not the library (names of the tracks are path names)? I also found that in the now playing view of xbmc the tracks are replaced by the paths for some seconds.

Otherwise really great work. I'm using it daily and love it. It's such a hassle to create a playlist in xbmc. This script is something I've been looking for for many years.
find quote
kiboy6 Offline
Fan
Posts: 632
Joined: Mar 2009
Reputation: 0
Post: #48
ErlendSB Wrote:Thanks mate!
Yes. I am aware of it. But i haven't figured out a good way to fix it yet. It can be done by adding some code to autoexec.py for deleting the .pid file. It's something you'd have to do yourself, as the autoexec.py file is outside the realm of the addon.
I can't remember where I saw the code, but I'll post it if I find it again.

Would love to see how that's possible thanks!

How is the script designed to work right now, in terms of enduring?
After the initial song is selected to start the playlist generation, if I then manually select a new song from the library will the script keep auto-generating songs?

Will it keep doing so until I run the script again to "exit party mode"? If so, (the script acts like a toggle switch) that's actually pretty cool. Will just have to make the edit to autoexec.py to make it either keep it's on/off status after a restart, or default to off.

Thanks againSmile
find quote
ErlendSB Offline
Senior Member
Posts: 187
Joined: Sep 2008
Reputation: 3
Location: Norway
Post: #49
DarkHelmet Wrote:How does the script pick a song, that is on more that one album? I have several tracks that are on a studio album and on one or more live albums. It seems like the script always picks that song from the same album. Would it be possible to randomize that somehow?

It's no big deal though, I was just wondering.

Have you found an answer as to why the generated list somehow seems to stem from the files section and not the library (names of the tracks are path names)? I also found that in the now playing view of xbmc the tracks are replaced by the paths for some seconds.

Otherwise really great work. I'm using it daily and love it. It's such a hassle to create a playlist in xbmc. This script is something I've been looking for for many years.

Songs are picked by searching through the xmbc music database for a matching track title and artist. It should be possible to randomize the selection if more than one track is found. It's a good idea! I'll look into it (note to self: order by random() limit 1Confused)

I have not seen results from the files selection. The selected tracks are picked from the database, where i believe only library tracks reside?! Maybe you need to clean the music database. The tracks are added to the playlist through their path name, so I guess it could also be missing/corrupt mp3 tags.
find quote
ErlendSB Offline
Senior Member
Posts: 187
Joined: Sep 2008
Reputation: 3
Location: Norway
Post: #50
kiboy6 Wrote:Would love to see how that's possible thanks!

How is the script designed to work right now, in terms of enduring?
After the initial song is selected to start the playlist generation, if I then manually select a new song from the library will the script keep auto-generating songs?

Will it keep doing so until I run the script again to "exit party mode"? If so, (the script acts like a toggle switch) that's actually pretty cool. Will just have to make the edit to autoexec.py to make it either keep it's on/off status after a restart, or default to off.

Thanks againSmile

The idea is to have the script add new songs when you manually change a track. (To adapt to mood changes)
But I'm not happy with it. When I pick a new track, the whole album is added, when I'd like for only the selected track to be queued.

So for the script to work best, you'd better queue new songs to the playlist instead of playing them (queuing the album), if that makes sense.

You're right in that the script acts as a toggle, and as you pointed out, you have to re-restart the script to make in work after restarting xbmc. I still haven't found the autotexec.py code. But I'll post it when i do. I just did a quick search for: "autoexec.py delete pid file". You might have more luck searching yourself. The idea is that xbmc itself needs to delete the .pid file inside the addon folder when xbmc starts. This prevents the "exit partymode" message from popping up when the script is not running.
find quote
kiboy6 Offline
Fan
Posts: 632
Joined: Mar 2009
Reputation: 0
Post: #51
ErlendSB Wrote:The idea is to have the script add new songs when you manually change a track. (To adapt to mood changes)
But I'm not happy with it. When I pick a new track, the whole album is added, when I'd like for only the selected track to be queued.

So for the script to work best, you'd better queue new songs to the playlist instead of playing them (queuing the album), if that makes sense.

This part is fine for me, because I run XBMC with the "Play the next song automatically" setting disabled. If I want to play an album I press "Queue" on the album. With your script, the last song of the album then attempts to generate a last.fm party playlist, which is fine by me too Smile

Quote:You're right in that the script acts as a toggle

That's fine too, although it seems that sometimes it stops working without me toggling it off. What events (if any) will stop the script attempting to generate a playlist? Pressing stop? Selecting "clear playlist" ?

Quote: and as you pointed out, you have to re-restart the script to make in work after restarting xbmc. I still haven't found the autotexec.py code. But I'll post it when i do. I just did a quick search for: "autoexec.py delete pid file". You might have more luck searching yourself. The idea is that xbmc itself needs to delete the .pid file inside the addon folder when xbmc starts. This prevents the "exit partymode" message from popping up when the script is not running.

Would love to do this, but my search only found this thread

I have close to zero experience in scripting, but if you could point me in the right direction of this whenever you have time that would be super kind of you.

I would also be perfectly happy, if the script just ran by default (with no dialogue) whenever XBMC starts - don't know if that's possible though.

Thanks so much Smile
(This post was last modified: 2011-05-05 12:09 by kiboy6.)
find quote
ErlendSB Offline
Senior Member
Posts: 187
Joined: Sep 2008
Reputation: 3
Location: Norway
Post: #52
I've uploaded a new version of the partymode addon.
Changes are:
The script will now be "toggled off" before exiting xbmc (actually when xbmc restarts, by using the autoexec.py file)
This is tested on windows, and may not work on unix system, so please let me know if this is the case

When multiple similar tracks are found, the script will pick one randomly (haven't been able to test this, but I believe it should work)
find quote
DarkHelmet Offline
Fan
Posts: 344
Joined: Jul 2008
Reputation: 0
Location: Hamburg, Germany
Post: #53
ErlendSB Wrote:I've uploaded a new version of the partymode addon.
Changes are:
The script will now be "toggled off" before exiting xbmc (actually when xbmc restarts, by using the autoexec.py file)
This is tested on windows, and may not work on unix system, so please let me know if this is the case

When multiple similar tracks are found, the script will pick one randomly (haven't been able to test this, but I believe it should work)

Could you please check your upload again? When I download I still get version 1.02.
find quote
ErlendSB Offline
Senior Member
Posts: 187
Joined: Sep 2008
Reputation: 3
Location: Norway
Post: #54
Hmm. I get 1.0.3 when I download it. Maybe it´s having trouble upgrading if the script is running. You can make sure it´s the right version by looking inside the addon.xml/changelog.txt file within the zip file. It should say version 1.0.3 somewhere at the top.

You could also try deleting the script.lastfmplaylistgeneratorPM folder, and install fresh.
find quote
DarkHelmet Offline
Fan
Posts: 344
Joined: Jul 2008
Reputation: 0
Location: Hamburg, Germany
Post: #55
I did as you told me, but it's still version 1.02 (confirmed by the changelog).
find quote
ErlendSB Offline
Senior Member
Posts: 187
Joined: Sep 2008
Reputation: 3
Location: Norway
Post: #56
Try this:

Go to:
http://code.google.com/p/lastfmplaylistgenerator/

Click script.lastfmplaylistgeneratorPM.zip on the bottom left hand side (under featured)
find quote
DarkHelmet Offline
Fan
Posts: 344
Joined: Jul 2008
Reputation: 0
Location: Hamburg, Germany
Post: #57
Still the same Confused
find quote
ErlendSB Offline
Senior Member
Posts: 187
Joined: Sep 2008
Reputation: 3
Location: Norway
Post: #58
wierd...Confused

The source code is here:http://lastfmplaylistgenerator.googlecod...mode/pm.py

If you can replace the contents of the pm.py file with the latest version, you should be good.
find quote
kiboy6 Offline
Fan
Posts: 632
Joined: Mar 2009
Reputation: 0
Post: #59
Hi Erlend - I'm having some real difficulties updating here too...

If in "install from zip file" the version doesn't change, and if I manually copy over the contents of the addon folder (including manually replacing the contents of pm.py with the source code you psted above) then I get a pm.py error when I try to run the script....

Strange...

Looking forward to getting it going - sound like exactly what I was hoping for! Thanks Smile
find quote
ErlendSB Offline
Senior Member
Posts: 187
Joined: Sep 2008
Reputation: 3
Location: Norway
Post: #60
Arg. It works here. Can u post back what xbmc.log says. That would help. I'll try another machine here aswell. It's strange but I probably did something silly. I'll look into it tonight
find quote
Post Reply