Porting MM4 scripts

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

Lowlander
Posts: 56491
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: Porting MM4 scripts

Post by Lowlander »

MMuser2011 wrote: Mon May 13, 2019 2:08 pmIf you read the answer from ZvezdanD you know: This will NOT happen.
Obviously, ZvezdanD has made that very clear. Doesn't change anything about the sentiment though.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Porting MM4 scripts

Post by ZvezdanD »

The first MM5 version available for download was on 12 Feb 2015 (https://www.mediamonkey.com/forum/viewt ... 68#p402260). I got the information about it by MM developers through the e-mail in 19 Jun 2015, when I posted the first post in (now) this thread. Before I posted that post, I downloaded the MM5 and also I took a look at their Web site with the new scripting API reference (http://www.mediamonkey.com/webhelp/MM5Preview). Which means it was ready for scripters to write scripts for MM5 even back then, four years ago.

The first MM that got the scripting support was also in Alpha stage (MediaMonkey 2.3.1.811 (Alpha 2)). I developed my first MM scripts when MM3 was in Alpha phase. Many scripters was also reluctant to write scripts for something which is unfinished even then, but hundreds of scripts by other authors was created when the old MM was in Alpha stage anyway. The situation is now the same as it was back then. There was "too many changes still going on" back then as well. Do you remember what problems caused their switching from MS Jet database used in MM2 to SQLite that was used later? Well, I know very well about that.

If you don't take a look at "downloads that come from the Addon developers sites" or this whole Forum, where else could you find MM5 add-ons? It is simple fact and you should face with it, there is not a single MM5 add-on. Anywhere. Four years after the public introduction and availability of the new API.

By the way, I am not talking here about "users holding back on upgrading to MediaMonkey 5", but about scripters holding back on upgrading to MM5. This thread (and this whole Forum) is (and should be) dedicated to the development of MM scripts, not the program.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
TIV73
Posts: 229
Joined: Sat Nov 12, 2011 1:31 pm

Re: Porting MM4 scripts

Post by TIV73 »

It's hard not to sympathize with both sides here. It's true, the backend switch kinda sucks. Years worth of functionality and support, in the form of addons, just go poof. This functionality can be rewritten of course, but that will take a considerable amount of time - and that's the best case scenario. More realistically, it's a question of 'if', not 'when'.
When MM5 releases, most people have two options - make the switch and lose stuff they got used to for close to a decade, or stay with MM4 which will eventually lose support. As a user, you are pretty much stuck between a rock and a hard place.

On the other hand I can't blame the developers for making this call. MM4 is built on technologies that are outdated, deprecated or dead. Of course they knew that a hard cut would, on top of having to rewrite the whole application from scratch, break all existing addon support, but what's the alternative? Keep supporting a scripting language that has been dead for years now? It's a bandaid they had to rip off sooner or later, and that always hurts, no way around it.

Personally, I don't really mind that much. Mediamonkey is a great media player, with or without addons. I'm not sure if I would recommend start writing extensions just yet. Right now I'm running 12 custom extensions (two of which are public) and it's very much like ZvezdanD said for MM4, stuff still gets changed around on a regular basis and it's likely that you will have to adjust your extension around these changes - especially if we are talking about skins. Seriously, don't write custom skins right now, it's not worth it.
Ludek
Posts: 4958
Joined: Fri Mar 09, 2007 9:00 am

Re: Porting MM4 scripts

Post by Ludek »

Seriously, don't write custom skins right now, it's not worth it.
Can you please elaborate why don't write custom skins right now?
Writing MM5 skins requires just basic HTML5/CSS3 knowledge (and is more powerful than MM4 skinning). We haven't changed the MM5 skinning framework for year(s) and we don't plan any significant change(s) to the MM5 skinning framework anymore.
We are adding some new elements/features (like waveform seekbar support in 2176+), but this is not breaking the existing skins.
So why it's not worth write custom skins?
TIV73
Posts: 229
Joined: Sat Nov 12, 2011 1:31 pm

Re: Porting MM4 scripts

Post by TIV73 »

Let me elaborate on what I meant - I'm currently using a custom skin that I originally made (judging from the git log) june last year, which I based on one of the built-in skins. Since then, the built-in skins were constantly improved, which is a good thing of course, and I've been, mostly, trying to keep up with the changes.

And there were quite a lot of changes since then. From what I recall there was never anything major or stuff that was broken, mostly small stuff. A column looking incorrect because its min or max width was changed, an element having the wrong color because a selector was changed, stuff like that. To be fair, from what I can tell the frequency of changes has somewhat slowed down.
Ludek
Posts: 4958
Joined: Fri Mar 09, 2007 9:00 am

Re: Porting MM4 scripts

Post by Ludek »

OK, thank you for the elaboration.

I guess that the last changes were when I was adding 'Material design' skins two years ago.
Since then there have been minimal changes AFAIK.

Anyhow, feel free to report any skinning issue (be it regression or feature request) and we will be glad to resolve it, e.g. in the next beta build there will be new "waveform bar" -- so check that it won't broke anything in your skins. Also, we should probably test also your skins whenever we are making a change to the default /skin/ directory ;-)
Finally, it is nice to see that anyone (except for us) is making MM5 skins!! ;-)
dypsis
Posts: 1335
Joined: Wed Apr 30, 2008 9:51 pm

Re: Porting MM4 Scripts

Post by dypsis »

I can tell you that I will be holding off on switching to MM5 until it can do what I have MM4 doing for me with scripts. :roll:


Just one small example. Trixmoto has a lot of great scripts, but he seems to have vanished from the forum. I am a big MonkeyRok fan, and unless that functionality comes to MM5, I will hold off switching for as long as possible.
dypsis
Posts: 1335
Joined: Wed Apr 30, 2008 9:51 pm

Re: Porting MM4 Scripts

Post by dypsis »

I have a short question.

What are the pros and cons for changing the scripting model?
TIV73
Posts: 229
Joined: Sat Nov 12, 2011 1:31 pm

Re: Porting MM4 scripts

Post by TIV73 »

The tl;dr version - MM up to version 4 is built on a framework that uses outdated and/or deprecated technologies. They still work, and probably will do so for quite a while, but at some point something will break, and when it does, you don't want your application to depend on it. Issue is that you completely break backwards compatibility.

It's a bit like the switch from VCR to DVD. Video tapes were still produced years after the DVD came out, so your VCR would work just fine for a while, but if you wanted to keep watching new movies, you had to bite the bullet at some point.

I also briefly spoke about the benefits and problems of using a new framework here and here.
dypsis
Posts: 1335
Joined: Wed Apr 30, 2008 9:51 pm

Re: Porting MM4 Scripts

Post by dypsis »

Thanks for your response, TIV73. 👍
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Porting MM4 scripts

Post by ZvezdanD »

I don't know what kind of answer do you expect from MM developers about pros and cons. It is obvious that they will praise their decision about the new scripting model mentioning some questionable benefits. They will not tell you "we jumped the shark" for sure.

I think many of you don't know or just forget, the old MediaMonkey scripting model had a support not only for VBScript, but also for JScript. Yes, you could write MM4 add-ons using JScript. The new program supports only JavaScript. It is not a good thing if you reduce the number of options.

The analogy with VCR and DVD is wrong since DVD was clearly much better technology than VCR. The DVD media is smaller and don't degrade fast as a magnetic tape, the recorders/players are smaller, the picture/audio quality is dramatically better, there is immediate jump to any location in the record without waiting the tape for fast forward/rewind, and so on. There was so many benefits in that transition to the new format.

However, JavaScript is not better than VBScript as MM developers want you to think. It is just another language with very similar basic concepts. It is just a matter of personal preference which language will be used and the fact that almost all MM scripts was written in VBScript tells me that that language is preferred among scripters for one or another reason.

Now, if we don't talk about the main scripting language of MM4 vs MM5, but about their API's, I already told you in this thread that the new API is very unintuitive, poorly documented and severely crippled comparing to the old one. I am telling you that as a long time MM scripter who wrote more than 3MB of scripts in total. You could compare APIs by yourself, here is the old one:
https://www.mediamonkey.com/wiki/index. ... on_objects
and here is the new one:
http://www.mediamonkey.com/webhelp/MM5Preview

There is a whole bunch of objects/properties/methods/events that I have used in my scripts which don't exist in the new API or don't have any alternative. If you have a single script which is 1,000 bytes long, maybe you will not have any problems in port, but if you have 1,000,000 bytes long script which uses hundreds of those object/properties..., then you are in trouble.

If you really want to use the analogy with VCR vs DVD, imagine the next situation: there is a tech company that manufactured thousands or even millions of DVD players and there is not a single movie released on DVD for 4 years and a half since not a single movie studio want to support such new format.

There is one thing related to the mentioned analogy with DVD. When Phillips and Sony decided to invent a new media format, they talked to the major movie studios like Universal and Fox. They asked them for their opinion about it. However, when MM developers decided to implement the new scripting model, they didn't inform any of existing scripters about it until it was already implemented. It was a fait accompli for us, a done deal.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
Lowlander
Posts: 56491
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: Porting MM4 scripts

Post by Lowlander »

MM5 is meant for cross platform distribution, whereas MM4 is Windows only. VBScript is an old Windows centric programming language. It's sad to see VBScript (it's my favorite) go and the loss of many MM4 scripts will be hard.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Porting MM4 scripts

Post by ZvezdanD »

MM5 for Windows is a Windows application. It already uses Windows-only technologies as COM. If I write a plug-in which communicates with the program using COM, such plug-in cannot be used with Mac or Linux version of the program (if/when that versions appear) since there is no COM on Mac or Linux.

So, if MM5 for Windows already supports COM that is not cross platform, what is stopping MM developers to add support for VBScript as well, at least in Windows version of the program? I think it is better to have at least scripts for Windows version, than not having scripts at all.

However, as I said, it is not only a problem because they ditched one scripting language. The much bigger problem is that their new API and the new COM are completely incompatible with the old ones and they are severely crippled. Could you believe that their new COM doesn't support any UI related stuff (and probably some other areas, like registry support, etc.)? Can you imagine any major MM4 script without the user interface?
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
Post Reply