I excluded ID 0 in the first SELECT statement. It is in the database, but is a dummy record in my case. This code obviously doesn't handle large gaps in ID numbers very well. Maybe it is better to use the old code but then use the resulting number as a record number into the Album table and retrieve the actual ID from the table. That would always work well (except with deleted records).

Hope this helps, it now works on my MediaMonkey with this modification.

There is theoretically no limit, as it is a string in an inifile. The standard access methods might have a limit, and it certainly wouldn't be a good idea to have a very high number, but what this number is I don't know. I tried with 50 and it seemed fine to me. If you want more, give it a try and let me know!

The memory is indeed persistent, so it will remember between MM sessions.

What trouble are you having? The best way to install the script is to download the installer from my website.

Or: Create a textfile called "{MM}\Scripts\Auto\AutoAlbumDJ.vbs" and paste the above code in. Then open "{MM}\Scripts\Scripts.ini" and add the following entry...

[AutoAlbumDJ2]FileName=Auto\AutoAlbumDJ.vbsProcName=AutoAlbumDJOrder=25DisplayName=Auto Album DJDescription=Auto Album DJLanguage=VBScriptScriptType=2

Then start MM and you should see a DJ icon on your toolbar with a green or red dot. If it's red, press the button to make it green. Next time you play the last song in your Now Playing list a new album should be added.

N.B. Don't forget to change the variables at the top of the script (MinTracks, AvgRating, MinRating, Capacity) if you wish to.

Thanks for the script. I was looking for something exactly like this. I do have some suggestions.

First Is there some way you could set it to only play albums within the same genre?

If you set that up I'd prefer to be able to set that option from within MediaMonkey (instead of by modifying the script). I'm not sure just how modifiable MediaMonkey is, so I'm not sure what is possible for you to accomplish.

If you can't set up an options menu directly in MediaMonkey, you could always pop up an options dialog any time AutoAlbumDJ is turned on. Or you could just write a script for modifying those variables which could be run from inside MediaMonkey.

Because of the problems I just erased my MM database and built a new one with only some albums (about 10). So it should be clean.
Then I downloaded trixmotos "AutoalbumDJ15.exe" and installed it by double clicking.

Now I start the MM, and I can see the DJ Button with a green square on it, so I assume it ist running. In my playlist are some songs left from my last session. So I play them all and it works fine. Exactly at the moment the last song in the playlist starts I can't do further actions in the MM, and my CPU usage goes to 100%. That's all! After this last song the sound stops and I still can't do something. The only one I can do ist to click right on MM's taskbar Icon and choose "close"

Maybe you could try cleaning your library (File, Clear Library) - you probably have some albums with no tracks in - this might be causing the problem. It shouldn't be able to get stuck in an infinite loop though.

trixmoto wrote:Maybe you could try cleaning your library (File, Clear Library) - you probably have some albums with no tracks in - this might be causing the problem. It shouldn't be able to get stuck in an infinite loop though.

This is what I already did. I tried it once again: I erased the library and then added only 4 albums. I checked in the album-node, that all shown albums are correct and the songs are in it. All seems perfect. But just one click on the DJ button, and it stucks