I'm struggling to get a script that I half-made myself working. I did just donate for the enhanced version so hopefully that'll help me learn more by having more scripts to look at...
Anyway, what I am trying to do is to select 500 random tracks from each listed genre, then limit the tracks per artist to 5.
The first part I think I've mostly successfully done properly, though it doesn't seem to be truly random... if that is even possible.
Here is what I've got so far that *seems* to work:
Code: Select all
Songs.ID IN (SELECT Songs.ID FROM Songs, (SELECT DISTINCT GenresSongs.IDGenre AS IDGenre FROM GenresSongs) AS G1 WHERE Songs.ID IN (SELECT Songs.ID FROM Songs, GenresSongs WHERE Songs.ID = GenresSongs.IDSong AND GenresSongs.IDGenre = G1.IDGenre ORDER BY Random() LIMIT 5000)) AND <Genre> IN ('Alternative', 'Asian Music', 'Dance', 'Electro', 'Folk', 'Metal', 'Pop', 'Punk', 'Rap/Hip Hop', 'Reggae', 'Rock')
This also seems to be *close* I believe, but I only end up with 5 results and it takes far longer than it should, especially since I reduced the songs down to 40 per genre:
Code: Select all
Songs.ID IN (SELECT Songs.ID FROM Songs, (SELECT DISTINCT GenresSongs.IDGenre AS IDGenre FROM GenresSongs) AS G1, Artists WHERE Songs.ID IN (SELECT Songs.ID FROM Songs, GenresSongs WHERE Songs.ID = GenresSongs.IDSong AND GenresSongs.IDGenre = G1.IDGenre ORDER BY Random() LIMIT 40) ORDER BY Artists.ID LIMIT 5) AND <Genre> IN ('Alternative', 'Asian Music', 'Dance', 'Electro', 'Folk', 'Metal', 'Pop', 'Punk', 'Rap/Hip Hop', 'Reggae', 'Rock')
I really wish there was a better manual out there... it's such a powerful tool yet I find it very confusing to write scripts in. If anyone has any other material I should read up on that'd be awesome
Edit:
Enhanced Version was just delivered!
The default script which selects "20 random files from 'Blues and Rock genre's" is what I built off in the free version. However it seems the enhanced version script is a tad different... It still works ALMOST how I need it to, I just need to figure out how to limit it to 5 tracks per artist

Should be easy... for anyone that knows Magic Nodes well I'd imagine.
Default Script for "Select 20 random files from 'Blues & Rock' Genres:"
Code: Select all
Songs.ID IN (SELECT Songs.ID FROM Songs, (SELECT DISTINCT IDGenre FROM GenresSongs) AS T1 WHERE Songs.ID IN (SELECT Songs.ID FROM Songs INNER JOIN GenresSongs ON Songs.ID = GenresSongs.IDSong INNER JOIN Genres ON GenresSongs.IDGenre = Genres.IDGenre WHERE GenresSongs.IDGenre = T1.IDGenre ORDER BY Random() LIMIT <Number|Caption:Number of files per Genre|Value:20|MinValue:0|MaxValue:100|ID:1>)) AND <Genre> IN ('Blues', 'Rock')
Edit:
SOLVED. PM me on Reddit if you want this mask. Same username.
I'm struggling to get a script that I half-made myself working. I did just donate for the enhanced version so hopefully that'll help me learn more by having more scripts to look at...
Anyway, what I am trying to do is to select 500 random tracks from each listed genre, then limit the tracks per artist to 5.
The first part I think I've mostly successfully done properly, though it doesn't seem to be truly random... if that is even possible.
Here is what I've got so far that *seems* to work:
[code]Songs.ID IN (SELECT Songs.ID FROM Songs, (SELECT DISTINCT GenresSongs.IDGenre AS IDGenre FROM GenresSongs) AS G1 WHERE Songs.ID IN (SELECT Songs.ID FROM Songs, GenresSongs WHERE Songs.ID = GenresSongs.IDSong AND GenresSongs.IDGenre = G1.IDGenre ORDER BY Random() LIMIT 5000)) AND <Genre> IN ('Alternative', 'Asian Music', 'Dance', 'Electro', 'Folk', 'Metal', 'Pop', 'Punk', 'Rap/Hip Hop', 'Reggae', 'Rock')[/code]
This also seems to be *close* I believe, but I only end up with 5 results and it takes far longer than it should, especially since I reduced the songs down to 40 per genre:
[code]Songs.ID IN (SELECT Songs.ID FROM Songs, (SELECT DISTINCT GenresSongs.IDGenre AS IDGenre FROM GenresSongs) AS G1, Artists WHERE Songs.ID IN (SELECT Songs.ID FROM Songs, GenresSongs WHERE Songs.ID = GenresSongs.IDSong AND GenresSongs.IDGenre = G1.IDGenre ORDER BY Random() LIMIT 40) ORDER BY Artists.ID LIMIT 5) AND <Genre> IN ('Alternative', 'Asian Music', 'Dance', 'Electro', 'Folk', 'Metal', 'Pop', 'Punk', 'Rap/Hip Hop', 'Reggae', 'Rock')[/code]
I really wish there was a better manual out there... it's such a powerful tool yet I find it very confusing to write scripts in. If anyone has any other material I should read up on that'd be awesome :)
Edit:
Enhanced Version was just delivered!
The default script which selects "20 random files from 'Blues and Rock genre's" is what I built off in the free version. However it seems the enhanced version script is a tad different... It still works ALMOST how I need it to, I just need to figure out how to limit it to 5 tracks per artist :lol: Should be easy... for anyone that knows Magic Nodes well I'd imagine.
Default Script for "Select 20 random files from 'Blues & Rock' Genres:"
[code]Songs.ID IN (SELECT Songs.ID FROM Songs, (SELECT DISTINCT IDGenre FROM GenresSongs) AS T1 WHERE Songs.ID IN (SELECT Songs.ID FROM Songs INNER JOIN GenresSongs ON Songs.ID = GenresSongs.IDSong INNER JOIN Genres ON GenresSongs.IDGenre = Genres.IDGenre WHERE GenresSongs.IDGenre = T1.IDGenre ORDER BY Random() LIMIT <Number|Caption:Number of files per Genre|Value:20|MinValue:0|MaxValue:100|ID:1>)) AND <Genre> IN ('Blues', 'Rock')[/code]
Edit:
SOLVED. PM me on Reddit if you want this mask. Same username.