Last.FM Node: dynamic node based on last.fm 2009.08.17 [MM3]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Postby CWuestefeld » Wed Feb 20, 2008 7:30 pm

Teknojnky wrote:if changing djminrating to -1 does not help, then I am at a loss why it is not working for you.


Yup, this fixed it.

The block of code that constructs the SQL is clearly the culprit. In SQL, any comparison to NULL always returns FALSE. So no unrated music will ever be considered.

IMHO, this is the wrong approach (especially at this point in the code, where it's only serving as an optimization). Right now I'm working on building up my DB on a new computer with the new MM3. So I thought that using Last.FM to "discover" the most likely tracks in my collection would be a good way to bootstrap my ratings.

But if unrated songs are always excluded, then I can't discover new songs that I've never bothered listening to before. I think that getting suggestions from Last.FM ought to be a discovery tool, and this interferes.

(with all respect, since you did invest all the time in building this!)
CWuestefeld
 
Posts: 7
Joined: Thu Jan 18, 2007 9:13 pm

Postby Bex » Wed Feb 20, 2008 8:11 pm

Well, unknown rating is stored with the value -1 and not NULL so that can't be the reason why it isn't working.
I rather suspect the lack of a % sign after the Artist Like is to blame here.
Try to change this:
Code: Select all
Qry = "Artist LIKE '%" & CorrectST(qArtist) & _
      "' AND SongTitle LIKE '" & CorrectST(qTitle) & "'" &_
      " AND SongLength > 60*1000 AND Rating >= " & DJMinRating

To This:
Code: Select all
Qry = "Artist LIKE '%" & CorrectST(qArtist) & _
      "%' AND SongTitle LIKE '" & CorrectST(qTitle) & "'" &_
      " AND SongLength > 60*1000 AND Rating >= " & DJMinRating

I think you might have trailing spaces in your artist or similar.
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Bex
 
Posts: 6268
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Postby Teknojnky » Wed Feb 20, 2008 8:28 pm

@ guest, yea I tried to keep it relatively simple when I implemented it, allowing specific ratings <>= and including/excluding unrated (-1) was more complicated that I wanted to get at that point. Perhaps in the future it may be implemented. And yea, I know SDJ has that functionality.

@ CW, I'm glad it is working for you now. As Bex commented, MM stores/identifies unrated as -1 and not null or zero (zero = bomb).

You may also want to set the 'avoid dupes' variable to FALSE so that it will list ALL occurances of a track that it can find in case you have different versions or duplicates of the same artist/track.

I added the variables at the top of the script so it would be somewhat customizable to handle various situations and preferences like this. :)

@ Bex, I think I originally included the trailing % on both the artist and the track title but I found it was finding artists which contained a particular substring of a different artist (I can't remember any particular example at the moment tho). And I took out the trailing % on the title because I remixes and such (acoustic/live/etc) were showing up instead of the main track title.
Teknojnky
 
Posts: 5508
Joined: Tue Sep 06, 2005 11:01 pm

Postby Bex » Wed Feb 20, 2008 8:43 pm

Ok, may I suggest this sql then:
Code: Select all
Qry = "SongTitle = '" & CorrectST(qTitle) & "' "&_
      "AND SongLength > 60*1000 AND Rating >= " & DJMinRating &" "&_
      "AND Songs.ID IN (SELECT IDSong FROM Artists WHERE Tracks>0 "&_
      "AND TRIM(Artist) = '" & CorrectST(qArtist) & "')"

I think it will work better!
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Bex
 
Posts: 6268
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Postby Teknojnky » Wed Feb 20, 2008 10:01 pm

tried it but got the error:


Image


note I am using querysongs here and not opensql (and opensql() didnt work either)
Teknojnky
 
Posts: 5508
Joined: Tue Sep 06, 2005 11:01 pm

Postby Bex » Thu Feb 21, 2008 3:13 am

Sorry, it should be like this:
Code: Select all
    Qry = "SongTitle = '" & CorrectST(qTitle) & "' "&_
          "AND SongLength > 60*1000 AND Rating >= " & DJMinRating &" "&_
          "AND Songs.ID IN (SELECT IDSong FROM ArtistsSongs, Artists  WHERE "&_
          "IDArtist=Artists.ID AND PersonType=1 AND TRIM(Artist) = '" & CorrectST(qArtist) & "')"
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Bex
 
Posts: 6268
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Postby Teknojnky » Thu Feb 21, 2008 1:29 pm

that seems to work and be faster too

edit:

wow that qry is super fast, I pulled my weekly user profile track list and it loaded 400+ tracks within the time out (i think the old qry barely found 100ish within the time out)
Teknojnky
 
Posts: 5508
Joined: Tue Sep 06, 2005 11:01 pm

Postby RedX » Thu Feb 21, 2008 7:38 pm

Teknojnky wrote:that seems to work and be faster too

edit:

wow that qry is super fast, I pulled my weekly user profile track list and it loaded 400+ tracks within the time out (i think the old qry barely found 100ish within the time out)


Do I hear update :-)
Thx technojnky for such a nice auto DJ plugin.

RedX
RedX
 
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Postby aidan_cage » Mon Mar 03, 2008 11:48 am

I can't seem to Terminate the process from the context menu of the process bar. If I select to play a new song while the AutoDJ is querying the script attempts to load a song from both the previously playing song and the newly selected song. If I choose to terminate the process linked to the previously playing song it just tries again.
can there be an easy terminate method?

OOO--also I want an option to automatically create a playlist of the tracks selected to play if the script has been running for, say, more than forty-five minutes--with the date and time as the playlist name :)

<3
aidan_cage
 
Posts: 291
Joined: Mon Dec 11, 2006 9:45 pm

Postby Teknojnky » Wed Mar 05, 2008 12:43 pm

script is updated, the only change should be the addition of Bex's sql query which should run much much smoother than the previous one I had.

@ Aidan, not sure what the problem with termination is, it seems to work for me but I will experiment around and see if there is situations that not work as expected.

regarding playlist generation, it was something I considered initially however it is not really something that fits in with the script very well, but is a very good idea for a separate script... possibly something like a right click menu to generate a playlist based on the selected track.

perhaps in the future I can work on something like that, or if one of the other scripters around has the time and inclination they could grab the bull by the horns and run with it.
Teknojnky
 
Posts: 5508
Joined: Tue Sep 06, 2005 11:01 pm

Postby Big_Berny » Fri Mar 07, 2008 7:53 am

Nice!

Anyway the ratings are still unadjusted: DJMinRating is 50 (46 would be better) and you somwhere use "WHERE Rating >= 70" (66 would be better).

Would be cool if you could 'fix' that. :) Very cool script...
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 2.4.3 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
Big_Berny
 
Posts: 1779
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland

Postby th80 » Sun Mar 30, 2008 9:07 am

Just wanna shout out a big "Thank you!" to Teknojnky and all who participate in developing this script. This is really great.
But one thing i would like: the dj mode should also play related tracks that are not rated.

EDIT: ok, forget the last point. DJMINRATING is my friend (plus i need some glasses).
th80
 
Posts: 12
Joined: Sun May 07, 2006 5:11 am

Scrobbling not working

Postby julial49 » Wed Apr 02, 2008 4:25 am

Sorry, if this has already been posted, I haven't checked every message in the thread because it is mostly about the DJ-Script.

Anyhoo:

the Scrobbler does not work for me. The part where the current song is displayed works fine but not the scrobbling itself. I have tried with and without the option about correct tags and several restarts of MM but no effect.

The LastFM_Cache.dat is getting bigger and bigger and in the LastFM_Log.txt the following lines are repeated for every song:

02.04.2008 11:22:42: Last.FM Handshake Started
02.04.2008 11:22:42: Last.FM Handshake: OK
02.04.2008 11:22:42: Last.FM Cache Submission: Started
02.04.2008 11:22:42: Last.FM Cache Submission: Connection To Last.FM interupted
02.04.2008 11:22:42: Last.FM NowPlaying: Update Started
02.04.2008 11:22:43: Last.FM NowPlaying: OK


This problem has been persistent for quite some time (I switched back to the original Winamp-plugin for a while) and it does not seem to be a Last.fm problem.

Any ideas?

Edit: sorry, wrong thread - could this post be moved please?
Last edited by julial49 on Wed Apr 02, 2008 4:31 am, edited 1 time in total.
julial49
 
Posts: 36
Joined: Wed May 09, 2007 8:33 am
Location: Germany

Postby spacefish » Wed Apr 02, 2008 4:29 am

This script doesn't scrobble. You want the native plugin thread here:

http://www.mediamonkey.com/forum/viewtopic.php?t=26404

As for the cache issue, it is a problem though not acknowledged. I've found that the plugin fails to restart on its own after a cache submission. If you close MM and re-open it, the plugin should reset provided the cache submission was successful. If it wasn't, you're going to continue to have tracks cached that may never submit. IMO, I would go back to the Winamp plugin and wait for the next version. It's what I've done.
Image
MM Gold 3.0.3.1183 : Vista HP SP1 (x86) : Zen Stone (2GB)
Zekton: An original MM3 skin by Eyal.
Scripts in Use: Add/Remove PlayStat | Auto Album DJ | AutoRateAccurate | Backup
Case & Leading Zero Fixer | Classification & Genre Changer | Clean Scripts.ini | Clear
Field | Custom Report | Discogs Auto-Tag Web Search | Forget Crossfade | Invert
Selection/Select None | Last 100... | Lyricator | Lyrics to Instrumental | MonkeyRok
MusicBrainz Tagger | My Custom Nodes | Now Playing Art Node | Play History & Stats
Right Click for Reports | Right Click for Scripts | Right Click for Web | Stop After Current
WebNodes
spacefish
 
Posts: 1427
Joined: Mon Jan 14, 2008 7:21 am
Location: Denmark

Postby Teknojnky » Fri Apr 11, 2008 11:50 am

I just uploaded a small but important update to avoid those pesky errors that can happen if you have tags updating in the background or multiple scripts running while last.fm dj mode is querying.

I also turned off logging by default since it can quickly become a huge file and the script is very stable now.

If you have had been running the default settings you may want to check the MM\scripts\auto\ folder for huge log files and delete them!

And apologies for not disabling that by default.
Teknojnky
 
Posts: 5508
Joined: Tue Sep 06, 2005 11:01 pm

PreviousNext

Return to Need Help with Addons?

Who is online

Users browsing this forum: No registered users and 10 guests