The Developer page in the Wiki has just a fraction of the material that is available for MM4. It has said "More Coming soon (MediaMonkey)" since forever.
So I was very pleased to notice today that Drakinite has posted up something that was genuinely useful. It broke through for me, as prior snippets that I had been given caused MM5 to break.
So many thanks Drakinite. I wonder if I could contribute a sub-page to your effort, to contain a Python specific page to help anyone get started ? .... PM me through the forum if you like.
The sample that Drakinite used as illustration in his wiki page is close to what I had been asking about. If that is not a happy coincidence, thank you for that too Drakinite.
Some comments:
- . Why is MM5 so fragile when running code that it received via SDB.runJSCode calls?
Example:
That call, and all my attempts to fix it, caused MM5 to break ... MM5 panel goes white .. all MM5 tasks need to be individually killed by the Windows Task Manager.PetrCBR wrote: ↑Fri Mar 30, 2018 5:13 am Your example does not work because you didn't returned value from getStringValue. app.getIniFile is asynchronous operation so you want to return value using runJSCode_callback (since MM5 2090).Code: Select all
SDB.runJSCode("(function() { app.getIniFile().then(function(iniFileAccess) { runJSCode_callback(iniFileAccess.getStringValue('System','DBName')) }); })()", True)
Why does a syntax error crash MM5?
And sometimes after it fails, and I have done the above housekeeping, connection is difficult to reestablish. .. (-2147023170, 'The remote procedure call failed.', None, None) ... and this where what was working before now fails
Can that be improved? - I also see your efforts on this page ... ie. The "supported in MM5?" column for the SDBApplication ActiveX class.
I looks like you were starting something that you didn't finish.
Is there any list of what was converted to MM5?
It seems to me to be a waste of their effort if they don't make any of it discoverable.
ie. did this happen?I know that ActiveX is not cross platform, but it very useful for anybody not from a web programming background, ie doesn't know javascript .. which atm seems about as much fun as poking sharp sticks into my eyes
- What is the easiest way to test JS functions before sending them to to MM5?
Example; the function that you ran to generate the playlist contents. what tool did you, when you were a pennyless student , use to test a function like that?
Is testable from the Shift+Ctrl+Alt DevTools Console that opens in the browser? ... Else what do you recommend for casual use? - The script that you used in your Wiki article gets me going, which is good.
But I am using it against MM5 AutoPlaylists. I have no control over how large the generated playlist may be, and I potentially have many playlists to generate, and it all happens during the close down of my app, so is noticeable if there is a delay. That method sends 55 (!) attributes per track, including lyrics.
My preference would be something that did something like this:- either trigger SendTo, for the tracks generated by AutoPlaylist 'xxx', to Static Playlist 'yyy' ... ie. all done inside the mm5 db, without getting all the 55 columns, and converting up and down into json
- or return the SQL statement which generated the tracklist ... it should be available because I can see it logged into the MM5 debug log. Much of he time I only need the album ids, so I only really need the Where, ORDER and Limit clauses
I am likely to be able to achieve that?
[UPDATE] re Q.2 ... the bit asking whether SDBPlayList was added to the MM5 COM implementation.
I see the answer. I have found out how to browse your COM package, and see that it has been implemented. Thanks.
It looks like I can pull down the tracklist from an AutoPlaylist, just using python and COM.
So that would appear to address Q.4 also.
It would help if the objects in your class were arranged in alphabetic order, ie not like this