Creating an Autoplaylist via script

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

Moderators: Peke, Gurus

DaledeSilva
Posts: 906
Joined: Sun May 28, 2006 4:22 am
Location: Australia
Contact:

Creating an Autoplaylist via script

Post by DaledeSilva »

hello.. I've created a script to search the database and find all the artists that have more than 3 highly rated tracks.. then it is supposed to create an autoplaylist based on the artists name and tracks rated higher than 3 stars.

The whole thing is created and the playlists get created but I cannot make them "auto" playlists... I mentioned this previously in another thread before creating the script and it was mentioned that it is possible... but I'm thinking that maybe it's not.

any assistance on how to do this would be absolutely great. Or any word on if it is even possible.

Thanks for any comment you might have,

Dale.
Product Designer & Indie Developer.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.
Lowlander
Posts: 58870
Joined: Sat Sep 06, 2003 5:53 pm

Post by Lowlander »

I believe the only attempt to do something with auto-playlists was done by TheRocket in http://www.mediamonkey.com/forum/viewtopic.php?p=10777. This only reads the field and calculates which tracks match.

This might help you on your way. I don't know if there are other methods available to create auto-playlists.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

The problem I think is that currently the only way I can think of adding one would be to directly write one into the database. But MM won't notice this until it starts up, maybe?
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.
DaledeSilva
Posts: 906
Joined: Sun May 28, 2006 4:22 am
Location: Australia
Contact:

Post by DaledeSilva »

I'm afraid dealing directly with the database directly may be a bit over my head... I'll have to rewrite it to just create normal playlists for now and hope that an easier method becomes available in a future version...

is this likely?

thanks for the help.

Dale.
Product Designer & Indie Developer.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky »

It's easy to create autoplaylists, but only possible if you have gold... is that your problem is that you don't have gold version?

Or are you trying to accomplish something that is not available via the normal autoplaylist dialogs?
DaledeSilva
Posts: 906
Joined: Sun May 28, 2006 4:22 am
Location: Australia
Contact:

Post by DaledeSilva »

Teknojnky,

I'm trying to automate auto playlist creation via scripting...

so I can make a script which has a loop in it and therefore creates a similar autoplaylist for each artist in a list of artists without having to manually create each one.

Dale.
Product Designer & Indie Developer.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky »

Ah, interesting... I hope a solution can be found, sounds like an interesting idea.. sounds like it can lead to alot of playlists tho.
DaledeSilva
Posts: 906
Joined: Sun May 28, 2006 4:22 am
Location: Australia
Contact:

Post by DaledeSilva »

actually.. it does create alot of playlists.. but not as many as you might think.. and certainly not simply doubling up on an artist node.

the script first goes through and reads everyfile in the database and counts, for each artist, the number of their tracks that are higher than a certain rating (let's say, 4 or 5 stars).

then, if that number is greater than 4 tracks (so the artist has at least 5 songs rated 4 stars or above) then it makes an auto playlist based on that criteria for that artist.

all the playlists are placed inside another playlist call "Artist - Groups" for good tree organisation.

the reason I made this is because I put songs on my ipod automatically by syncing an autoplaylist of 3 stars or higher out of my whole library. but when I'm listeing to my ipod.. sometimes I only want to here the songs I REALLY REALL dig by an artist.. so I have these playlists... but at the moment I've only manually created them for a few artists because I can't be bothered creating them.. but with the script I can create ALL of them in a few seconds. And the script can be adapted to other playlist types as well.

because it seems autoplaylist creation isn't possible (at lease for me)... I will have to create normal playlists (which requires more integrated playlist populating throughout the script - whereas an autoplaylist could simply be created at the end)....
...however, it means that if I then rate some more of any of the same artists... the lists wont automatically update, I will have to run the script again.

I can still make it quite useful.. but obviously autoplaylist creation would be much more useful in so many more circumstances.

Dale.
Product Designer & Indie Developer.
Building at the intersection of motion, art, and code.
Find me on twitter and all the other ones here.
MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia

Post by MoDementia »

I just spent a little time around Auto and Normal Playlists for my script and this is what I found.

This is from the standard "Favorites - Top 50" Playlist in the table playlists field QueryData.

I looks like the format of an .ini file but there isn't a member for playlist = QueryData i.e. Playlist.QueryData :(

Code: Select all

[Common]
QueryVersion=1
QueryType=2
[Adv]
ConditionsCount=1
OrdersCount=2
LimitTop=1
Top=50
[AdvCond1]
DBField=Songs.PlayCounter
Condition=32
Value=0
[AdvSO1]
Order=Songs.PlayCounter
Asc=0
[AdvSO2]
Order=Songs.LastTimePlayed
Asc=1
Post Reply