Auto Album DJ 3.8 - Updated 08/08/2010

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

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

Post by Abel » Fri Apr 07, 2006 10:08 am

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: Barton, UK
Contact:

Post by trixmoto » Sat Apr 08, 2006 4:09 pm

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.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

tooscaredtotry
Posts: 130
Joined: Mon Apr 03, 2006 5:31 pm
Contact:

Post by tooscaredtotry » Sat Apr 08, 2006 9:19 pm

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: Barton, UK
Contact:

Post by trixmoto » Sun Apr 09, 2006 6:07 am

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.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

Sammy20
Posts: 110
Joined: Thu Feb 17, 2005 5:42 am

Post by Sammy20 » Wed Apr 19, 2006 8:15 am

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: Barton, UK
Contact:

Post by trixmoto » Wed Apr 19, 2006 10:31 am

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.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

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

Post by trixmoto » Sun Apr 23, 2006 2:18 pm

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.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

Guest

Post by Guest » Wed May 24, 2006 1:49 pm

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: Barton, UK
Contact:

Post by trixmoto » Thu May 25, 2006 3:07 am

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.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

jjbuchan
Posts: 11
Joined: Thu May 11, 2006 6:05 pm

Post by jjbuchan » Fri May 26, 2006 10:34 am

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 » Fri Jun 16, 2006 10:02 am

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: Barton, UK
Contact:

Post by trixmoto » Fri Jun 16, 2006 10:36 am

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.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

Speed Pete
Posts: 39
Joined: Thu Jun 15, 2006 11:30 am

Post by Speed Pete » Sat Jun 24, 2006 10:37 am

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: Barton, UK
Contact:

Post by trixmoto » Sun Jun 25, 2006 4:51 am

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.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

Speed Pete
Posts: 39
Joined: Thu Jun 15, 2006 11:30 am

Post by Speed Pete » Sun Jun 25, 2006 5:30 am

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