Auto Album DJ 3.8 - Updated 08/08/2010

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

Moderators: Peke, Gurus

Abel
Posts: 38
Joined: Mon Dec 19, 2005 6:11 pm
Location: NYC

Post by Abel »

I did some debugging on the script and found the problem.

The problem is that the script assumes that the IDAlbum column has values in the range [0, number of albums]. This is not true, at least not in my database. In fact the first ID is 1750.

The fix would be to change the first part to

Code: Select all

'select random album
Dim sql, iter, max
sql = "SELECT Min(ID) As Lowest, Max(ID) As Highest FROM Albums where ID > 0"
Set iter = SDB.Database.OpenSQL(sql)
min = CLng(iter.StringByName("Lowest"))
max = CLng(iter.StringByName("Highest"))
And then change the part to calculate the random ID to:

Code: Select all

ind = Int(max*Rnd)+1+min
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.

Abel
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Thanks for finding the bug. I will have to investigate the best way to error trap this and find a robust solution. Glad you have found something that works in your case.
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.
tooscaredtotry
Posts: 130
Joined: Mon Apr 03, 2006 5:31 pm
Contact:

Post by tooscaredtotry »

Great script. I used it about 90% of the time.

I have a suggestion for the next version. Could you include a button like ScrobblerDJ that I can use to toggle AlbumDJ on/off?
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Yes, I will look into adding a toolbar button in the next version.
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.
Sammy20
Posts: 110
Joined: Thu Feb 17, 2005 5:42 am

Post by Sammy20 »

Just wondering, whats the maximum number of albums to remember one can enter? Does it remember these albums after MM is closed?
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

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.
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 »

New version (1.5) has a toolbar button to switch it on and off. This means you'll need to download the two icons, if you don't use the installer from my website.

http://trixmoto.net/files/aadjon.ico
http://trixmoto.net/files/aadjoff.ico

:o New version below :o
Last edited by trixmoto on Thu Jun 29, 2006 6:49 pm, edited 1 time in total.
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.
Guest

Post by Guest »

I am having dificulty runing this script. Cant get to work .. any idea? And one else having problems or there just me?! Thanx! MM 2.5.3.959
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

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.vbs
ProcName=AutoAlbumDJ
Order=25
DisplayName=Auto Album DJ
Description=Auto Album DJ
Language=VBScript
ScriptType=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.
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.
jjbuchan
Posts: 11
Joined: Thu May 11, 2006 6:05 pm

Post by jjbuchan »

Great script. I was wondering why it didn't work for me the first time I tried, but now I see I have to alter the min rating variable, as hardly any of my tracks are rated.

I setled for using the normal AutoDJ before but now I'll use this all the time. Thanks!
atari7800
Posts: 1
Joined: Fri Jun 16, 2006 9:51 am

Post by atari7800 »

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.

Thanks again.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

I will create a new version with an options sheet. And add a genre filter! :)
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.
Speed Pete
Posts: 39
Joined: Thu Jun 15, 2006 11:30 am

Post by Speed Pete »

Can you help me with a problem please? This is what I did:

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" :(

Any Ideas, what the problem is??
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

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. :-?
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.
Speed Pete
Posts: 39
Joined: Thu Jun 15, 2006 11:30 am

Post by Speed Pete »

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 :(
Post Reply