Different ini-update-handling in MM 3.1?

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Different ini-update-handling in MM 3.1?

Re: Different ini-update-handling in MM 3.1?

by MoDementia » Tue Jan 13, 2009 1:56 am

Nice Link Bex, secret MM business hey?

Re: Different ini-update-handling in MM 3.1?

by Bex » Mon Jan 12, 2009 8:34 pm

Yes, I can confirm that. I think it started in 1205. Anyway, the changes are correctly made within MM's internal memory so any scripts works correct. It's a bit unusual to not see the made changes in the ini file until MM is shut down.
Btw, if you use an alias or not is not an issue anymore, they are all treated the same. In fact, Jiri recommends to use alias:
http://www.mediamonkey.com/forum/viewto ... 07#p182207

Re: Different ini-update-handling in MM 3.1?

by Teknojnky » Mon Jan 12, 2009 8:21 pm

jiri wrote:The only difference is when you use ini file object as a variable, e.g.

Set inif = SDB.IniFile
inif.StringValue...
inif.StringValue...
...

if you however use it as

SDB.IniFile.StringValue("x", "y") = "z"

then the change will be immediatelly written to disk.

Jiri
In 1212,
SDB.IniFile.StringValue("x", "y") = "z"

then the change will be immediatelly written to disk.
Is FALSE. Read/writing to the ini values do persist inbetween script instances, however the changes are NOT written until MM is closed.

Re: Different ini-update-handling in MM 3.1?

by Teknojnky » Fri Dec 19, 2008 2:16 pm

Jiri, what does this change fix or improve that is important to break compatibility with existing scripts?

Re: Different ini-update-handling in MM 3.1?

by Big_Berny » Thu Dec 04, 2008 4:55 pm

Hi jiri,
ok, so we can use 'SDB.IniFile.StringValue("x", "y") = "z"' instead for the party we really need immediate inifile-update?

By the way: What happens if there are more instances which modify the ini (with inif.StringValue...)? Will always the last running instance be written on the disc?

Re: Different ini-update-handling in MM 3.1?

by jiri » Thu Dec 04, 2008 3:15 pm

The only difference is when you use ini file object as a variable, e.g.

Set inif = SDB.IniFile
inif.StringValue...
inif.StringValue...
...

if you however use it as

SDB.IniFile.StringValue("x", "y") = "z"

then the change will be immediatelly written to disk.

Jiri

Re: Different ini-update-handling in MM 3.1?

by MoDementia » Thu Dec 04, 2008 3:08 pm

I reread Big Berny's post, does it mean that the ini is now only local to the script that opens/write it?

If so this really is a big problem where the script has child scripts
i.e. main script writes a value for the html onevent script to read?

Re: Different ini-update-handling in MM 3.1?

by MoDementia » Thu Dec 04, 2008 2:52 pm

Hmm, I know of 1 problem I will have.

If you run a vbscript from a html page you cannot get a msg box, the only way I have been able to debug this part of scripts is to write it to the ini.
Now I have to create my own text file to debug? :(

Just debugging in general will be a pain, especially for users; we can't ask them to look at the ini i.e. before they click ok etc

Re: Different ini-update-handling in MM 3.1?

by jiri » Thu Dec 04, 2008 2:09 pm

Yes, ini file is only saved when the ini file object instance is destroyed, e.g. when the script terminates or by setting

Set ini = Nothing

I hope that it won't cause much trouble.

Jiri

Different ini-update-handling in MM 3.1?

by Big_Berny » Thu Dec 04, 2008 9:00 am

Hi devs,
I just discovered problem with AutoRateAccurate and MM Pre-3.1.

Problem:
To prevent the script from running multiple times at the same time, I write into the mediamonkey.ini 'ini.StringValue("AutoRateAcc", "IsWorking") = "True"'. Now I have a problem with this part since 3.1 because it seems to set IsWorking to "True" (I can see that if I run 'SDB.Messagebox ini.StringValue("AutoRateAcc", "IsWorking"), mtWarning, Array(mbOK)' afterwards WITHIN THE SAME SCRIPT-INSTANCE) but it doesn't really saves this modified mediamonkey.ini. At least the ini on the harddisk didn't get modified (directly), it seems like it would be in a sort of cache. If now a second instance of the script runs and tries to look if another instance is already running it thinks that it isn't because in the ini which it loads 'ini.StringValue("AutoRateAcc", "IsWorking") = "False"' and not 'ini.StringValue("AutoRateAcc", "IsWorking") = "True"', altough it should be.

I also tried to pause a instance to look the mediamonkey.ini in my text-editor and it really shows the old 'ini.StringValue("AutoRateAcc", "IsWorking") = "False"' altough the running scrpt shows me per msgbox that it should be 'True'.

Big_Berny

Top