add/rescan from a script

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderator: Gurus

add/rescan from a script

Postby jon_beeker » Sat Jul 31, 2010 12:53 pm

Hi, I have a simple question that I cannot figure out. I am trying to completely automate the handling of my library with scripts, but cannot see a way to get MM to add/rescan from a script. Is this possible?

Also, is there a command line option that will run a specific script at startup? ie, once a week, I would like to run script “a.vbs” on startup, but most of the time script “b.vbs” where a.vbs is a maintenance script that takes a long time to run and I do not want to do it all the time. Like I said, I am trying to completely automate various tasks.

Thanks in advance, Jon
jon_beeker
 

Re: add/rescan from a script

Postby trixmoto » Sun Aug 01, 2010 4:44 am

It might have been clearer if you'd described what "a.vbs" and "b.vbs" were doing, but on the assumption that if "a.vbs" is taking a long time then it's the one that you want to run the file monitor, and only once a week. As you can't currently trigger the file monitor from a script, how about setting the "ScanOnStart" to true as you shutdown once a week and then at shutdown switch it off if it's on. I believe this would have the desired affect. The file monitor settings are stored in "MediaMonkey.ini" here...

Code: Select all
[AutoScan]
autoRemoveDeadLinks=0
autoRemoveAttributes=1
FolderCount=2
Path1=D:\Music\_Downloaded\
Subfolders1=1
ScanOnStart1=1
Path2=D:\Music\
Subfolders2=1
ScanOnStart2=0


...so for me I have the whole "Music" folder monitored, but only the "_Downloaded" folder at startup. It's the "ScanOnStart1" and/or "ScanOnStart2" which would need to be modified for me. Does this make sense?
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9711
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Re: add/rescan from a script

Postby jon_beeker » Sun Aug 01, 2010 1:34 pm

Thanks, that might work for me. I will give it a try.
jon_beeker
 

Re: add/rescan from a script

Postby jon_beeker » Mon Aug 02, 2010 12:36 pm

Ok, that did not go so well.

I can read from the mediamonkey.ini file with "msgbox SDB.IniFile.BoolValue("AutoScan","ScanOnStart1")" -->Returns true
but if I set the value with "SDB.IniFile.BoolValue("AutoScan","ScanOnStart1") = False", the next time I start the program it is back to True.

How do you write to the ini file?

Thanks again, Jon
jon_beeker
 

Re: add/rescan from a script

Postby trixmoto » Mon Aug 02, 2010 3:03 pm

Unfortunately some ini values cannot be changed because they are stored internally and cannot be updated here. You can't change the auto-tag from web source either, which I have complained about before! I've been assured this will be resolved in a future version, but looks like this won't be possible at the moment.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9711
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK


Return to Addons developer forum

Who is online

Users browsing this forum: No registered users and 1 guest