XBMC Community Forum
[RELEASE] Last.FM Playlist Generator Script - Auto Generate Similar Music Playlists - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Add-ons Help and Support (/forumdisplay.php?fid=27)
+---- Forum: Music Add-ons (/forumdisplay.php?fid=148)
+---- Thread: [RELEASE] Last.FM Playlist Generator Script - Auto Generate Similar Music Playlists (/showthread.php?tid=83915)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20


- ErlendSB - 2011-07-15 11:43

I query the music database via the QueryMusicDatabase httpapi, so if this api can work with mysql, it should work. I guess the tables and views in the databases (sqlite and mysql) are the same?! I have not tried using mysql myself, so I can't tell for sure.
Other than that, make sure you have imported all the song to the library, as this addon does not work in files mode only.


- kiboy6 - 2011-07-15 13:32

ErlendSB Wrote:I haven't noticed this myself, but I suspect it can occur if the trackname or artist contains special characters. Do you have an example?

Sorry for taking so long to get back to you on this.

I think the issue may just be that there are many songs that surprisingly have no "people who listen to this also like" results on last.fm.

eg. Indestructible by Robyn

Is there anything clever you could do for songs like this? Perhaps just base it on the artist somehow, maybe by using results from another song of theirs that does have results.


One other small bug I think I've found in the script:

After the "no similar tracks were found" I believe the script becomes inactive until quit and restarted.

Thanks so much - I still use this on a a daily basis Smile


- RockDawg - 2011-07-15 15:41

ErlendSB Wrote:I query the music database via the QueryMusicDatabase httpapi, so if this api can work with mysql, it should work. I guess the tables and views in the databases (sqlite and mysql) are the same?! I have not tried using mysql myself, so I can't tell for sure.
Other than that, make sure you have imported all the song to the library, as this addon does not work in files mode only.

I was working from within the library. It looks like it may be related to the mysql. As a test, I disabled the mysql db, ansd scanned some folders into the nomal sqlite db and the script seemed to work fine.

What a bummer because I was so jazzed to find this addon as it's exactly what I'm wanting. But alas, no joy. Anyways, kudos and a great job on this addon. It seems like it would be really sweet.


- RockDawg - 2011-07-16 03:32

I did some more testing, and the script definitley doesn't work with mysql db. It never finds a match in the library. I guessing the the query syntax is different between sqlite and mysql? Anyway here is a snippet from my log:

Code:
20:56:19 T:5260 M:1476464640   DEBUG: HttpApi Start command: setresponseformat  paras: setresponseformat; openRecordSet;<recordset>;closeRecordSet;</recordset>;openRecord;<record>;closeRecord;</record>;openField;<field>;closeField;</field>
20:56:19 T:3132 M:1476464640  NOTICE: Count: 250
20:56:19 T:5260 M:1476464640   DEBUG: HttpApi Start command: QueryMusicDatabase  paras: QueryMusicDatabase; select strTitle, strArtist, strAlbum, strPath, strFileName, strThumb, iDuration from songview where strTitle LIKE '%%Bad Company%%' and strArtist LIKE '%%Bad Company%%' order by random() limit 1
20:56:19 T:5260 M:1476464640   ERROR: SQL: Undefined MySQL error: Code (1305)
                                            Query: select strTitle, strArtist, strAlbum, strPath, strFileName, strThumb, iDuration from songview where strTitle LIKE 'Bad Company' and strArtist LIKE 'Bad Company' order by random() limit 1
20:56:19 T:5260 M:1476440064   ERROR: CMusicDatabase::GetArbitraryQuery(select strTitle, strArtist, strAlbum, strPath, strFileName, strThumb, iDuration from songview where strTitle LIKE '%Bad Company%' and strArtist LIKE '%Bad Company%' order by random() limit 1) failed
20:56:19 T:5260 M:1476435968   DEBUG: HttpApi Start command: QueryMusicDatabase  paras: QueryMusicDatabase; select strTitle, strArtist, strAlbum, strPath, strFileName, strThumb, iDuration from songview where strTitle LIKE '%%Ramble On%%' and strArtist LIKE '%%Led Zeppelin%%' order by random() limit 1
20:56:19 T:5260 M:1476435968   ERROR: SQL: Undefined MySQL error: Code (1305)

The query is repeated in the log many times with different artists.


- ErlendSB - 2011-07-16 12:57

Thanks for the log.
I suspect the syntax for random is different. If you could try modifying line 100 in pm.py from: order by random() to order by rand()
If this works, I´ll make some sql detection code Smile
PM me if you want me to send you a modified version


- RockDawg - 2011-07-17 07:37

That change worked. Thanks so much!


- muppetman - 2011-08-04 11:53

Hi, thanks for your time and effort on this add-on. I just installed it. Running Crystalbuntu on Atv1. I have 12 500 songs across 750 albums. I have tried the playlist generator on over 20 songs (by popular artists/well known songs) and it hasn't found a match yet. Running v1.08 off repo.

Am I doing something wrong? Is there something else I need to install or do?

Help appreciated!!


- ErlendSB - 2011-08-04 12:00

muppetman Wrote:Hi, thanks for your time and effort on this add-on. I just installed it. Running Crystalbuntu on Atv1. I have 12 500 songs across 750 albums. I have tried the playlist generator on over 20 songs (by popular artists/well known songs) and it hasn't found a match yet. Running v1.08 off repo.

Am I doing something wrong? Is there something else I need to install or do?

Help appreciated!!

Can you post the log? I've never tried it on linux, but I believe it should work there as well.


- muppetman - 2011-08-04 16:12

Here you go.

http://pastebin.com/NMTck3SC

Many thanks for your help!!


- ErlendSB - 2011-08-05 12:04

I can see from your log that matches are being found (see all the "NOTICE: Found:" entries in the log file)

There might be and issue with file paths stored in the library db, but for now can you try changing the settings to:
Allow same track to play more than once = YES
Prefer different artist = NO