Tutorial to MediaMonkey, anyone?

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

Would you like a tutorial on scripts in MediaMonkey?

You may select 1 option

 
 
View results

almo9004
Posts: 21
Joined: Wed May 03, 2006 6:29 am
Location: Sweden

Post by almo9004 »

@ trixmoto:
Sorry man, it doesn't work.
I'm getting the exact same error as before. :x :cry:

I think we are gonna need some serious help from the pros... :wink: :)
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true."
Robert Wilensky, about the Infinite monkey theorem
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Oh yes, to reference GenreName you need to do a JOIN with the Genre table but you can't do that in the WHERE statement. You might need to do an OpenSql with...

Code: Select all

SELECT Songs.ID FROM Genres INNER JOIN Songs ON Genres.IDGenre = Songs.Genre WHERE Genres.GenreName LIKE 'Pop'
Hopefully someone has a way for you to do it with the QuerySongs if this is not helpful to you.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Actually I think Pop is always 13 so you could try...

Code: Select all

SDB.Database.QuerySongs("AND Genre=13")
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex »

First of all. Trixi is a pro! Bigtime!

This also works if you must use SDB.Database.QuerySongs:

Code: Select all

SDB.Database.QuerySongs("AND Genre in (Select IDGenre From Genres Where GenreName  = 'Pop')")
But is a bit slower than "= 13" due to the inline.

/Bex
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
almo9004
Posts: 21
Joined: Wed May 03, 2006 6:29 am
Location: Sweden

Post by almo9004 »

@ Bex:
Yey, your suggestion worked and it was a quite simple solution, even if most of it is greek to me. :D

@ Trixmoto:
I hope I didn't hurt you with my unsensitive behaviour and possible assault. :oops:
I'm working on your suggestion, but I seem to run into some problems. As far as I know, it returns an SDBDBIterator from which you can extract the (record) index of the song.
But how do I turn the numbers into songs? :)

Thank you all for your responds, you have helped me greatly! :D
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true."
Robert Wilensky, about the Infinite monkey theorem
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Yes, my solution is not ideal as you then need to do a QuerySongs using each ID to get each song, which is obviously slower. I was not offended by your comments, SQL is not my strong point. Bex's solution is the best, he's an SQL guru! :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Post Reply