Plugins compatibility since switch to Movian

Added by Anthony Dahanne almost 8 years ago

Hello,
I manually installed latest Movian version to my ps3 (showtime-4.9.559.pkg), and the plugins I wrote (tou.tv https://github.com/anthonydahanne/showtime-plugin-tou.tv, tv5video.ca https://github.com/anthonydahanne/showtime-plugin-tv5video.ca and 2 others) are not available from the plugins list from Movian interface.
That said, they're still listed as public plugins on this page : https://movian.tv/plugins/movian

So I'm wondering, did something change ? does something prevent my plugins to be downloaded to Movian 4.9 ? What do I need to change in them so that they can be downloaded from Movian ?

Thanks,
Anthony


Replies (4)

RE: Plugins compatibility since switch to Movian - Added by Andreas Smas almost 8 years ago

Yes, the old plugins ran using a javacript engine called SpiderMonkey which now have been replaced with Duktape.

Basically, you need to change your plugin to have type: "ecmascript" in plugin.json and then try to run it.

It should be mostly compatible but if you run into problems it should be straight forward to fix (spidermonkey had some non-ecmascript-5 compatible things like 'const', etc)

If you run into problems, just ask here.

RE: Plugins compatibility since switch to Movian - Added by Anthony Dahanne almost 8 years ago

Hello Andreas,
Thanks for your answer.
So I did the change, and the most recurring issue I had was to change the :

for each (variable in objet) {
  //instruction
}

to :

object.forEach(function(variable) {
  //instruction
});

see https://github.com/anthonydahanne/showtime-plugin-vtele.ca/commit/311606b0cd7aa6471d33832742be71640f0f1ff6#diff-04c2e3600087585372060b41b2906c6bL141 for example.
Anyway, I did that in most of my plugins and it seems to have worked (btw, could you please approve them ? thanks, I have 2 approval requests waiting)
Now, I have a new issue :
00:37:52.736: tv5video.ca     [DEBUG]: Getting episodes list : http://m.video.tv5.ca/api/json/tools/loadSerieEmissions 2736
00:37:52.737: tv5video.ca     [ERROR]: TypeError (not callable) at file:///Users/anthony/workspaces/movian/showtime-plugin-tv5video.ca/tv5video.js:67
00:37:52.737: tv5video.ca     [ERROR]: STACK DUMP: TypeError: not callable
00:37:52.737:                              duk_js_call.c:682
00:37:52.737:                              anon file:///Users/anthony/workspaces/movian/showtime-plugin-tv5video.ca/tv5video.js:67 preventsyield
00:37:52.737:                              apply  native strict preventsyield
00:37:52.737:                              anon showtime/page:366 preventsyield

because of :

    showtime.trace("Getting episodes list : " + EPISODES_URL + " " + emissionId);
    var objectData = {"parameters" : "{\"id\":" + emissionId + ",\"pagesize\":\"16\",\"page\":1}"}
    (#67) var getEpisodesResponse = showtime.httpPost(EPISODES_URL, objectData);

It used to work, any ideas ?
Thanks again Andreas,
Anthony
PS : I'm working against Movian 4.10 , release/4.10 branch, commit 444f6782badf9adc0121a4c0025303968f24e301

RE: Plugins compatibility since switch to Movian - Added by Leonid Protasov almost 8 years ago

Hi, Anthony!

httpPost as well as httpGet are deprecated. Just use httpReq. Take a look at the wiki to see how much power it has now. Or just use as is.

RE: Plugins compatibility since switch to Movian - Added by Anthony Dahanne almost 8 years ago

Leonid Protasov wrote:

Hi, Anthony!

httpPost as well as httpGet are deprecated. Just use httpReq. Take a look at the wiki to see how much power it has now. Or just use as is.

OKee, done, I've replaced with httpReq and it works again.
Thanks !
(BTW could you please approve tv5video.ca ? thanks again !)

(1-4/4)