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 Morten » Sun Jan 27, 2008 7:42 pm

I think you can use the Installation package to install that icon as well Teknojunky.
Image
Morten
 
Posts: 1090
Joined: Thu Aug 11, 2005 11:31 am
Location: Norway

Postby Teknojnky » Sun Jan 27, 2008 10:41 pm

@ RedX: yea, I tested it seems to work ok with the relative paths, just the PNG did not work (altho I thought I tested that initially)

@ Morten: yes a MMIP pack would which I hope to get something done soon, I wanted to make sure you could update in place without re-starting MM and the save/load functionality put in..

@ all I think I will implement saving/loading nodes similar to magic nodes/favorite nodes does, by saving to mediamonkey.ini.. altho I think that too much stored in the mediamonkey.ini will eventually be bad.. Perhaps all script related INI settings should have a 'scriptsettings.ini' so that mediamonkey.ini doesn't get filled up with script options..

Also, I have updated script and implented one last function as a surprise.. just play a track and select the root 'Last.FM Node' and see what happens... 8)
Teknojnky
 
Posts: 5508
Joined: Tue Sep 06, 2005 11:01 pm

Postby aidan_cage » Sun Jan 27, 2008 11:06 pm

I still am having a hard time believing you just willed this script into existence

WOW

PEACE

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

Postby spacefish » Sun Jan 27, 2008 11:13 pm

What? No black icon for the Paint It Black crew? For shame! ;)

Image

Borrowed from the Greasemonkeys group Favicon Changer thread.
Last edited by spacefish on Sun Jan 27, 2008 11:29 pm, edited 1 time in total.
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 » Sun Jan 27, 2008 11:17 pm

oh nice, I will have find/make an .ICO version of that... I use the black style also.
Teknojnky
 
Posts: 5508
Joined: Tue Sep 06, 2005 11:01 pm

Postby Diabolic-Destiny » Mon Jan 28, 2008 2:14 am

amazin thanks tek
Image
Image
Diabolic-Destiny
 
Posts: 223
Joined: Sun Apr 29, 2007 9:45 pm

Postby Onweerwolf » Mon Jan 28, 2008 6:09 pm

Amazing script Teknojnky!
Image
Onweerwolf
 
Posts: 542
Joined: Tue Dec 12, 2006 5:32 pm
Location: The Netherlands

Postby miki4000 » Tue Jan 29, 2008 9:36 am

This is gold! :lol:

m
--
baard
miki4000
 
Posts: 15
Joined: Sun May 22, 2005 7:34 am

Postby istanbul » Wed Jan 30, 2008 3:29 am

What an excellent idea! I'm impressed.

I desperately want to get this script working, but get the following error message when clicking on the name of the artist, tag etc. I've entered:

There was a problem querying the database:
42000:[Microsoft][ODBC Microsoft Access Driver] Syntaksfeil(operator mangler) i spørreuttrykket Songs.IDAlbum=Albums.ID AND Songs.IDArtists=Artists.ID AND Alb.Art.ID=Albums.IDArtist
Artist LIKE '%damien rice' AND SongTitle LIKE '%9 crimes'

The Norwegian bit translated: Syntax error (operand missing) in the query...

Upon clicking 'cancel':

Error #-2147418113 - SongsDB.SDBDatabase
42000:[Microsoft][ODBC Microsoft Access Driver] Syntaksfeil(operator mangler) i spørreuttrykket Songs.IDAlbum=Albums.ID AND Songs.IDArtists=Artists.ID AND Alb.Art.ID=Albums.IDArtist
Artist LIKE '%damien rice' AND SongTitle LIKE '%9 crimes'
File: ".....last.vbs", Line: 1039, Column: 8


I am using version 2.5.3.968.
istanbul
 
Posts: 15
Joined: Tue Oct 02, 2007 11:51 am

Reducing CPU usage

Postby dressen » Wed Jan 30, 2008 3:46 am

Awesome script Teknojnky!

Can I make a small suggestion to reduce CPU usage/overhead when waiting for the XML to come back?

In LoadXML, add a SDB.Tools.Sleep call, e.g.

Code: Select all
  Do While xmlDoc.readyState <> 4 And (Timer-StartTimer) < Timeout
    SDB.Tools.Sleep 10


Above that, reduce the MaxValue of LoadXMLBar so that the progress bar still shows progress, e.g.

Code: Select all
  LoadXMLBar.MaxValue = 500


Both the Sleep and MaxValue values can be tuned as needed, but this will knock down CPU usage to almost nil since the Loop iterations are a lot less. The new Sleep function in MM3 is very handy!
dressen
 
Posts: 11
Joined: Tue Feb 13, 2007 3:09 am
Location: Seattle, WA

Postby trixmoto » Wed Jan 30, 2008 4:21 am

I agree that adding "Sleep" will be very useful for looping like this, but alternatively you could use a timer. I guess the trouble with using a timer is that you have to store all the objects globally so you can access them in the ontimer sub.

Anyway, I generally "sleep" for 100 when calling Last.Fm - this will still check every 10th of a second!! :)
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby Teknojnky » Wed Jan 30, 2008 9:24 am

Wow I was not aware of the sleep method.. I will have to try it..

I am not really getting much cpu use with the ReadState loop... most of the processing occurs with the songquery loop. I set the maxvalue very high so it actually appears to progress, otherwise it maxed out almost instantly. I will experiment with the sleep call tho, sounds like a good solution.

Normaly the xml ready is very short unless last.fm is lagged or down. I added the timer count to the statusbars and logs so I could time what portions were taking the longest to better optimize in the future.

@ Istanbul this script requires Mediamonkey Version 3 and it appears you have MM 2...

You can find the latest release canidate for 3.02 in the beta testing forum sticky, the last post in the thread has the latest release.

edit:

I tried out the sleep function, it seemed to work fine without bogging down the UI.

I settled on sleep of 100 and maxvalue of 250, the current time out being 25 seconds, this matches up nicely between the time out and the progress filling up.. later once I add options Ill set the maxvalue based on timeout * 100 for neatness.
Last edited by Teknojnky on Wed Jan 30, 2008 11:39 am, edited 1 time in total.
Teknojnky
 
Posts: 5508
Joined: Tue Sep 06, 2005 11:01 pm

Postby Teknojnky » Wed Jan 30, 2008 11:02 am

Does anyone know of a better way to transfer from one songlist to another songlist besides a loop doing one track at a time? Basically I want to combine from one songlist to another in one fast method.

I am building 2 song lists.. one is the list from last.fm of tracks that are found in your library, the other is the list of results from the qry (which can return multiple hits)..

The way I started out doing this worked with one list because I had the qry as part of the list building stage.

Later I had to break out the qry as a separate function (because the last.fm xml feed's have different structures) and now I have the list from the qry (that can return multiple matches) and the total songlist of all matched tracks..

So I want to add the results of the qry to the running total of matched, without doing each song individually via loop.
Teknojnky
 
Posts: 5508
Joined: Tue Sep 06, 2005 11:01 pm

Postby istanbul » Wed Jan 30, 2008 1:32 pm

I've hesitated until now to make the transition to MM3, but this script made me do it - works like a dream now! Thanks!
istanbul
 
Posts: 15
Joined: Tue Oct 02, 2007 11:51 am

Postby trixmoto » Wed Jan 30, 2008 2:34 pm

Unfortunately I think you'll need to loop through the songlist. It should be reasonably fast though.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

PreviousNext

Return to Need Help with Addons?

Who is online

Users browsing this forum: No registered users and 12 guests