Kodi Community Forum
Release plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+---- Forum: Skin helper addons (https://forum.kodi.tv/forumdisplay.php?fid=300)
+---- Thread: Release plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners (/showthread.php?tid=345847)



RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - jurialmunkey - 2019-12-22

(2019-12-21, 16:45)bsoriano Wrote: @jurialmunkey , I am testing the latest version from GitHub running in the latest Matrix nightly.  I am getting the following error whenbrowsing the plugin and trying to get details for a cast member:

Thanks for the bug report - I hadn't tested that section on Matrix. Should be fixed on latest. Big Grin


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - jurialmunkey - 2019-12-22

(2019-12-21, 13:27)nessus Wrote: The only info that are missing now are the media flags, eg ListItem.VideoResolution for the local items.
...
What about this one?
Would only be available if I merged local info with online info, which I'm avoiding. If it is something that is desperately needed, I could add a param to merge with local info but it will add additional overhead.

(2019-12-21, 19:51)nessus Wrote: That's fine. I am already closing the info dialog when an item is playable. IMHO this is proper behavior and makes it clear to the user that it opens the info dialog for a different item. If you don't want to add this then we will need a click action to run the script and show the video info for that clicked item.

It isn't possible to open an info dialog from the info dialog because Action(Info) closes the dialog and once the dialog is closed the item no longer exists to open an info dialog for.

If you're trying to have an ExtendedInfo type experience, then you have two options:
  1. Use the custom window implementation for TMDbHelper as done in AZ2
  2. Use Sualfred's extended info replacement "script.embuary.info" - https://forum.kodi.tv/showthread.php?tid=346034

The TMDbHelper implementation is as follows:

Onclick Action for Video Info Dialog Lists
Code:
<onclick condition="String.IsEmpty(ListItem.DBID) + !String.IsEmpty(ListItem.Property(tmdb_id))">RunScript(plugin.video.themoviedb.helper,add_path=$INFO[ListItem.FolderPath],call_id=1137,prevent_del)</onclick>
This action adds the item's path to $INFO[Window(Home).Property(TMDbHelper.Path.Current)] and then calls ActivateWindow(1137). You can change the call_id to any custom window ID that you wish to use.

Window 1137
xml:

<?xml version="1.0" encoding="UTF-8"?>
<window type="window" id="1137">
<defaultcontrol always="true">9999</defaultcontrol>
<controls>
<control type="button" id="9999">
<onfocus>ReplaceWindow(1136)</onfocus>
</control>
</controls>
</window>
All this window does is call window ID 1136 (again you can use any custom window ID, these are just the ones used in AZ2). It's basically a trick to force 1136 to update.

Window 1136
This window has a hidden list with TMDbHelper.Path.Current (which is the detailed item path we added). It sits in a focus loop until the item loads and then calls Action(Info) to open the info dialog
xml:

<?xml version="1.0" encoding="UTF-8"?>
<window type="window" id="1136">
<defaultcontrol always="true">9999</defaultcontrol>
<controls>
<control type="list" id="9999">
<width>1</width>
<height>1</height>
<left>-1000</left>
<top>-1000</top>
<onfocus condition="!Integer.IsEqual(Container(9999).NumItems,0) + !Container(9999).IsUpdating + !String.IsEmpty(Window(Home).Property(TMDbHelper.Path.Current))">Action(Info)</onfocus>
<onfocus condition="[Integer.IsEqual(Container(9999).NumItems,0) | Container(9999).IsUpdating] + !String.IsEmpty(Window(Home).Property(TMDbHelper.Path.Current))">AlarmClock(doinfo,SetFocus(9999),00:01,silent)</onfocus>
<onfocus condition="String.IsEmpty(Window(Home).Property(TMDbHelper.Path.Current))">Action(Back)</onfocus>
<itemlayout />
<focusedlayout />
<content limit="1" target="videos">$INFO[Window(Home).Property(TMDbHelper.Path.Current)]</content>
</control>
</controls>
</window>

DialogVideoInfo
Finally, in DialogVideoInfo you need an onunload condition to clear the path on back:
Code:
<onunload condition="!String.IsEmpty(Window(Home).Property(TMDbHelper.Path.Current))">RunScript(plugin.video.themoviedb.helper,del_path,call_id=1137)</onunload>


This method will keep a history of the paths used. Look at AZ2 for some advanced tricks that I do to add actor info page (https://github.com/jurialmunkey/skin.arctic.zephyr.2/blob/master/1080i/Custom_1136_TMDB_Info.xml) and also add paths for local items into the history by using some additional onclick actions and url encoded library nodes (https://github.com/jurialmunkey/skin.arctic.zephyr.2/blob/master/1080i/Includes_Defs.xml#L96-L106) - though these are both advanced features that aren't necessary. The above implementation will work to replace extended info.


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - nessus - 2019-12-22

(2019-12-22, 01:32)jurialmunkey Wrote:
(2019-12-21, 13:27)nessus Wrote: The only info that are missing now are the media flags, eg ListItem.VideoResolution for the local items.
...
What about this one?
Would only be available if I merged local info with online info, which I'm avoiding. If it is something that is desperately needed, I could add a param to merge with local info but it will add additional overhead.  
I understand, but in my dialog layout i have a place holder for media flags when it's open from videos section (on movies & episodes) and that will be empty when opened from widgets. Can you add that param to test it?. My system it's not so new and powerful so i can have good picture if the additional overhead notically affects the performance.
 
(2019-12-22, 01:32)jurialmunkey Wrote: This method will keep a history of the paths used. Look at AZ2 for some advanced tricks that I do to add actor info page (https://github.com/jurialmunkey/skin.arctic.zephyr.2/blob/master/1080i/Custom_1136_TMDB_Info.xml) and also add paths for local items into the history by using some additional onclick actions and url encoded library nodes (https://github.com/jurialmunkey/skin.arctic.zephyr.2/blob/master/1080i/Includes_Defs.xml#L96-L106) - though these are both advanced features that aren't necessary. The above implementation will work to replace extended info.
OΚ, I'll see what I'll do with it. Thanks a lot for the integration guide.


Now...TV Shows widgets questions:
1. The ListItem.DBID it's empty for all TMDB tv shows lists. In Trakt lists  it's working fine.
3. I always missed the trailer option for tv shows from most of the scrapers. On my surprise with your plugin shows the trailers for tv shows. The weird thing is that are available only in widgets lists. In video library are missing for all shows (cached or not) even for shows that are in one of the widgets lists. Can this be fixed.

Thanks
Nessus

P.S. I would like to thank you a lot for all your help and patience to all these messages and questions. I really appreciate it and apologize if at any point i'm get annoying or persistent.


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - jurialmunkey - 2019-12-22

(2019-12-22, 13:11)nessus Wrote: I understand, but in my dialog layout i have a place holder for media flags when it's open from videos section (on movies & episodes) and that will be empty when opened from widgets. Can you add that param to test it?. My system it's not so new and powerful so i can have good picture if the additional overhead notically affects the performance.
Okay, I'll add something tomorrow. I'll keep you posted.
 

(2019-12-22, 13:11)nessus Wrote: Now...TV Shows widgets questions:
1. The ListItem.DBID it's empty for all TMDB tv shows lists. In Trakt lists  it's working fine.
3. I always missed the trailer option for tv shows from most of the scrapers. On my surprise with your plugin shows the trailers for tv shows. The weird thing is that are available only in widgets lists. In video library are missing for all shows (cached or not) even for shows that are in one of the widgets lists. Can this be fixed.

Both these work fine for me. Matching for tvshows is done on the basis of title because some scrapers don't store the imdb id. Check that the plugin language settings match your scraper language settings.

Here's an item from TMDb top rated list with trailer and dbid:
Image

And here's the same item in library also with trailer in service monitor:
Image


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - nessus - 2019-12-23

@jurialmunkey 
Well, i've rebuild my tv shows library and the missing ListItem.DBID it's fixed in widgets. Something must have gone wrong there, although from all my 21 tv shows still in "Game Of Thrones" the DBID it's missing in the widget list  (eg Trending TV Shows). Also, the ListItem.Trailer it's still empty for all shows in tv shows section while in widgets it's filled fine after caching. Here are some debug info screens from both widgets and tv shows....

Image

Image

You see the missing ListItem.Trailer in tv shows (which is missing from all shows in tv shows section) and the missing DBID in widgets ("Trending TV SHows" in this case) while the ListiIem.Trailer it shows fine. Also, i've refresh the cache and even i removed the simple cache db just to test it fresh but nothing happen.

Any ideas?


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - jurialmunkey - 2019-12-23

(2019-12-23, 03:51)nessus Wrote: You see the missing ListItem.Trailer in tv shows (which is missing from all shows in tv shows section)
"videodb://tvshows/titles" - The mystery is solved! That's not a path from the plugin. Only scrapers can change values in your library.
That's the whole reason why Window(Home).Property(TMDbHelper.ListItem.Infolabel) is needed in the first place!
If I could edit listitems directly, I would.

(2019-12-23, 03:51)nessus Wrote: ... and the missing DBID in widgets ("Trending TV SHows" in this case) ...
DBID shows fine for me on trending tv shows widget.

How are you checking that DBID is set for widgets? Do you use a custom window debug overlay? Because a custom window can't access specific container IDs - you need to include the overlay labels directly in Home.xml


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - jurialmunkey - 2019-12-23

@nessus - Also, can you test latest commit. I've added an option in settings to retrieve additional details from local kodi db, so you should get codec info for dbid items with that on. Let me know if the setting is enough or if you also need a per widget param.


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - nessus - 2019-12-23

(2019-12-23, 04:37)jurialmunkey Wrote: "videodb://tvshows/titles" - The mystery is solved! That's not a path from the plugin. Only scrapers can change values in your library.
That's the whole reason why Window(Home).Property(TMDbHelper.ListItem.Infolabel) is needed in the first place!
If I could edit listitems directly, I would.
Ok then. I will fallback the infoproperty for the trailer infolabel.
 
(2019-12-23, 04:37)jurialmunkey Wrote: DBID shows fine for me on trending tv shows widget.
Yea... for all the others except... "Game of Thrones". This is the only show that for some weird reason the DBID is empty. Not a big issue but i am curious why it happens only for this one. My DBID checking (in home.xml) it's working properly because like i said, in all the others it's showing fine.
 
(2019-12-23, 04:40)jurialmunkey Wrote: @nessus - Also, can you test latest commit. I've added an option in settings to retrieve additional details from local kodi db, so you should get codec info for dbid items with that on. Let me know if the setting is enough or if you also need a per widget param.
Well, i don't see any noticeable overhead with setting enabled. It will be nice to have a widget param for this so if the skinner wants it can work out of the box.


Thanks
Nessus


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - jurialmunkey - 2019-12-23

(2019-12-23, 12:40)nessus Wrote: Yea... for all the others except... "Game of Thrones". This is the only show that for some weird reason the DBID is empty. Not a big issue but i am curious why it happens only for this one. My DBID checking (in home.xml) it's working properly because like i said, in all the others it's showing fine.
Odd. DBID is being found for Game of Thrones on my end.
If there is a mismatch between library and tmdb for title or year fields, then there won't be a match.

(2019-12-23, 12:40)nessus Wrote: Well, i don't see any noticeable overhead with setting enabled. It will be nice to have a widget param for this so if the skinner wants it can work out of the box.

Okay added. &amp;localdb=True


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - nessus - 2019-12-23

Mystery solved!. Game of Thrones ListItem.Year in my local library, scraped from TVDB, is 2010 while in TMDB it's 2011. I've check several other sources and all of them have 2011 as first year. I dunno why TVDB has it as 2010 since the airdate of the first episode is 17/04/2011. Anyway... mystery solvedBig Grin

Thanks for the param.

Cheers
Nessus


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - nessus - 2019-12-24

(2019-12-20, 22:52)jurialmunkey Wrote: Sorry I misunderstood what you were suggesting. You can already change the default action to play with the &amp;widget=True param.
This param makes Movies|Episode = Play and TvShows = Browse Seasons.
The TvShows = Browse Seasons action it's not working. Movies|Episode = Play it's working fine. Don't know if it was like that from the beginning or it broke after the latest commits. Can you please check it out?

EDIT: Also ListItem.Property(UnWatchedEpisodes) is empty in widgets lists. The &amp;widget=True and &amp;localdb=True param are set and working properly.


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - jurialmunkey - 2019-12-24

(2019-12-24, 10:15)nessus Wrote: The TvShows = Browse Seasons action it's not working. Movies|Episode = Play it's working fine. Don't know if it was like that from the beginning or it broke after the latest commits. Can you please check it out?
You need an onclick action that closes the info dialog and opens the folderpath. Any info dialog widget with folder items, regardless of whether it is from a plugin or local library, will require a custom onclick action that closes the info dialog and then opens the folder path for it to work.

You can do that with the following action:

xml:

<onclick condition="ListItem.IsFolder">Dialog.Close(12003)</onclick>
<onclick condition="ListItem.IsFolder + Window.IsVisible(MyVideoNav.xml)">Container.Update($INFO[ListItem.FolderPath])</onclick>
<onclick condition="ListItem.IsFolder + !Window.IsVisible(MyVideoNav.xml)">ActivateWindow(videos,$INFO[ListItem.FolderPath],return)</onclick>


(2019-12-24, 10:15)nessus Wrote: EDIT: Also ListItem.Property(UnWatchedEpisodes) is empty in widgets lists. The &amp;widget=True and &amp;localdb=True param are set and working properly.

I wasn't merging any watched information, just the scraped metadata - but I can merged watched status if you like.


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - nessus - 2019-12-25

(2019-12-24, 23:35)jurialmunkey Wrote: You need an onclick action that closes the info dialog and opens the folderpath. Any info dialog widget with folder items, regardless of whether it is from a plugin or local library, will require a custom onclick action that closes the info dialog and then opens the folder path for it to work.
Sorry, i was not clear enough in my message. I didn't mean Browse from inside the info dialog. I meant from outside, in widget lists, when you click on an item that is in the local library....
(2019-12-20, 22:52)jurialmunkey Wrote: You can already change the default action to play with the &amp;widget=True param. This param makes Movies|Episode = Play and TvShows = Browse Seasons.
 Didn't those were the default actions provided by the script when clicking on widget item ?

 
Quote:I wasn't merging any watched information, just the scraped metadata - but I can merged watched status if you like.
If it is not so much trouble i would like to have the option to show these for local items in widgets lists.


EDIT: Also ListItem.MPAA in TV Shows widgets lists it's empty for non-local library items.


Merry Christmas!!!.
My best wishes to you and your family!!!.


Thanks
Nessus


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - jurialmunkey - 2019-12-25

(2019-12-25, 02:49)nessus Wrote: Sorry, i was not clear enough in my message. I didn't mean Browse from inside the info dialog. I meant from outside, in widget lists, when you click on an item that is in the local library....
Works fine for me.
Do you have target="videos" in your <content> tag? i.e. <content target="videos">

All items open in the plugin (i.e. you get the plugin's season view not the library season view) - that's the expected behaviour and something I'm not willing to override. If you're looking for a way to open the local library instead of the plugin, then you will need to add your own custom onclick:
xml:
<onclick condition="!String.IsEmpty(ListItem.DBID) + String.IsEqual(ListItem.DBType,tvshow)">ActivateWindow(videos,videodb://tvshows/titles/$INFO[ListItem.DBID]/,return)</onclick>

(2019-12-25, 02:49)nessus Wrote: Didn't those were the default actions provided by the script when clicking on widget item ?
Only if the widget=True param is set (or the user changes the select action setting in the addon). If you set widgets using skinshortcuts, the widget param will be automatically added to the plugin path.

 
(2019-12-25, 02:49)nessus Wrote: If it is not so much trouble i would like to have the option to show these for local items in widgets lists.
Local watched status is merged in latest update (only merges if the setting or param for local db info is set).

(2019-12-25, 02:49)nessus Wrote: EDIT: Also ListItem.MPAA in TV Shows widgets lists it's empty for non-local library items.
Needs to be cached - MPAA not available in standard TMDb lists without details API call.


RE: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners - bsoriano - 2019-12-29

@jurialmunkey , thanks for making this plugin better and better!

What visibility condition should I set (or what should I do) for my custom cast panel when the info is coming from the plugin service monitor, but it has not finished updating? Right now I have only numitems > 0 and isupdating for the panel, and what usually happens is that the first time I press Info on a widget item from the plugin, I get no cast.  Then, the second time I press Info on that same item, the cast will appear, since the monitor has finished updating the info and it is most likely cached also.

Thanks for your help.

Regards,

Bart

EDIT: @jurialmunkey, this is what I have for the custom cast right now.  The results are inconsistent, meaning for some widget items the cast is shown, for others it is not.

xml:

<!-- Custom Cast panel item: either container 50 (default) or container 5100 (tmdb online info) -->
    <include name="CustomCastItemOnline">
        <param name="CastListItemID" />
        <definition>
            <item>
                <label>$INFO[Window(Home).Property(TMDbHelper.ListItem.Cast.$PARAM[CastListItemID].Name)]</label>
                <label2>$INFO[Window(Home).Property(TMDbHelper.ListItem.Cast.$PARAM[CastListItemID].Role)]</label2>
                <icon>$INFO[Window(Home).Property(TMDbHelper.ListItem.Cast.$PARAM[CastListItemID].Thumb)]</icon>
                <visible>!String.IsEmpty(Window(Home).Property(TMDbHelper.ListItem.Cast.$PARAM[CastListItemID].Name))</visible>
            </item>
        </definition>
    </include>
    <!-- Custom Cast panel items -->
    <include name="CustomCastListContentOnline">
        <include content="CustomCastItemOnline">
            <param name="CastListItemID">1</param>
        </include>
        <include content="CustomCastItemOnline">
            <param name="CastListItemID">2</param>
        </include>
        <include content="CustomCastItemOnline">
            <param name="CastListItemID">3</param>
        </include>
        <include content="CustomCastItemOnline">
            <param name="CastListItemID">4</param>
        </include>
        <include content="CustomCastItemOnline">
            <param name="CastListItemID">5</param>
    </include>
    <!-- Cast Panel: Always use a custom cast to have control over actions -->
    <include name="CustomCast">
        <control type="group" id="90049">
            <top>44</top>
            <height>44</height>
            <visible>Container(90050).IsUpdating | Integer.IsGreater(Container(90050).NumItems,0) | String.IsEmpty(Window(Home).Property(TMDbHelper.IsUpdating))</visible>
            <control type="label">
                <left>8</left>
                <top>0</top>
                <height>30</height>
                <label>$LOCALIZE[206] $INFO[Container(90050).NumItems,(,)]</label>
                <font>ListDetails</font>
            </control>
            <control type="image" description="Line Split">
                <top>40</top>
                <left>10</left>
                <width>1180</width>
                <height>1</height>
                <texture>img/LineL.png</texture>
                <aspectratio>stretch</aspectratio>
            </control>
        </control>    
        <control type="panel" id="90050">
            <top>44</top>
            <left>10</left>
            <width>1180</width>
            <height>410</height>
            <onup>9000</onup>
            <onback>9000</onback>
            <preloaditems>2</preloaditems>
            <scrolltime tween="quadratic" easing="out">300</scrolltime>
            <orientation>horizontal</orientation>
            <visible>Container(90050).IsUpdating | Integer.IsGreater(Container(90050).NumItems,0) | String.IsEmpty(Window(Home).Property(TMDbHelper.IsUpdating))</visible>
            <!-- select online tmdb search or local search -->
            <onclick>SetProperty(Dialog.1.Label,$LOCALIZE[32018])</onclick>
            <onclick>SetProperty(Dialog.1.BuiltIn,RunScript(plugin.video.themoviedb.helper,add_query=$INFO[Container(90050).ListItem.Label],type=person,call_id=1129,prevent_del))</onclick>
            <onclick>SetProperty(Dialog.2.Label,$LOCALIZE[32017])</onclick>
            <onclick>SetProperty(Dialog.2.BuiltIn,Skin.SetString(CustomSearchTerm,$ESCINFO[Container(90050).ListItem.Label])||Dialog.Close(all)||ActivateWindow(1122))</onclick>
            <onclick>RunScript(script.embuary.helper,action=createselect,header=$LOCALIZE[137])</onclick>
            <include content="ActorLayout">
                <param name="viewid">90050</param>
            </include>
            <content>
                <include>CustomCastListContentOnline</include>
            </content>
        </control>
    </include>