Release plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners
#88
(2019-08-12, 01:31)bsoriano Wrote:
(2019-08-11, 23:45)jurialmunkey Wrote:
(2019-08-11, 17:31)bsoriano Wrote: @jurialmunkey , thank you so much for providing a reference implementation! I took a look and I am not quite sure why window 1137 is required? Pardon me if this is obvious and I am just not skilled enough to understand it right away.

Regards,

Bart

It's to force window 1136 to reload when changing the plugin path.

If you activatewindow(1136) from 1136, Kodi doesn't reload the window as you're already there. As a result, you don't get any windowclose/open animations. Also, what happens is the videoinfo dialog closes, the plugin path in hidden list id="9999" changes, but DialogVideoInfo never reopens because 9999 doesn't get focus (I think it is because it already had focus before DialogVideoInfo was triggered).

If you look at id="9999" in 1136, you will see a trick I do where I wait from the plugin path to load before calling the info dialog. Basically when the list is focused, the condition checks if it's finished updating and has an item - if yes it does Action(Info) and opens DialogVideoInfo, if no it sets a 1 second alarmclock to set focus back on the list and retrigger the checks. It keeps repeating this loop until the item loads and the info dialog opens (it also has an additional check for if the plugin path is for a person and sets focus to the "fake" info dialog which is the code below the list).

To get the above trick to trigger, you need to setfocus(9999). However, you can't do it from inside DialogVideoInfo as Kodi thinks you want to focus a control in the dialog. You can set a delay with an alarmclock, but you have to hope that the delay correctly syncs with your DialogVideoInfo closing animation - most of the time it is fine, but occasionally you get a delay with Kodi closing a window and then the setfocus won't work correctly.

Instead what I do is activatewindow(1137) and then once that window loads, I immediately do a replacewindow(1136) [replacewindow means that the current window is not added to the window history]. This way I can completely clear window 1136 and then reload it with the new item - it makes it act like I'm opening it for the first time every time and so the plugin path is empty and focus gets set to 9999 correctly. It also ensures that I get nice dialog opening and closing animations.

@jurialmunkey, thank you so much! This is truly advanced skinning! Are you OK with me adapting your code for Amber? Please let me know. Thanks.

Regards,

Bart
Yeah go for it!

The main advantage of doing things this way versus using sualfreds script is that you can mix local and online content using only the native info dialog (sualfreds script is certainly much easier to setup though!). You also get much more control over how windows are managed

If you look at the onclick actions for my lists you will see I have a different path for items with a dbid. This is a local library path filtered by the title of the item (basically smart playlist rules as a folder path). That way you get the local content with the native info dialog.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply


Messages In This Thread
RE: TheMovieDB Helper - by jurialmunkey - 2019-07-31, 11:47
RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - by jurialmunkey - 2019-08-12, 01:55
Logout Mark Read Team Forum Stats Members Help
plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners2