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-08

(2019-12-07, 13:49)bsoriano Wrote: EDIT: @jurialmunkey , there seems to be an issue with the ListItem.Duration returned by the service monitor.  It is returning really high values, like 8520 for Star Wars: The Rise of SkyWalker.  Is there a conversion to minutes missing here perhaps?

Ah I forgot that Window Properties don't have time formatting options!

Okay latest version will return the following:

Total Min - e.g. returns "125" for a 2hr 5m duration.
Code:
Window(Home).Property(TMDbHelper.ListItem.Duration)

Hours - e.g. returns "2" for a 2hr 5m duration.
Code:
Window(Home).Property(TMDbHelper.ListItem.Duration_H)

Minutes - e.g. returns "5" for a 2hr 5m duration.
Code:
Window(Home).Property(TMDbHelper.ListItem.Duration_M)

HH:MM - e.g. returns "02:05" for a 2hr 5m duration.
Code:
Window(Home).Property(TMDbHelper.ListItem.Duration_HHMM)



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

(2019-12-07, 04:26)jurialmunkey Wrote: @nessus - I've just added several properties related to airing status:

Status = Continuing, Ended etc.
Last_Aired = Last aired date
Next_Aired = Next aired date

You can also get details about next/last episode
e.g.
$INFO[Window(Home).Property(TMDbHelper.ListItem.Last_Aired.Plot)]
$INFO[Window(Home).Property(TMDbHelper.ListItem.Next_Aired.Name)]

Available properties:
Last_Aired | Last_Aired.Episode | Last_Aired.Name | Last_Aired.Tmdb_Id | Last_Aired.Plot | Last_Aired.Season | Last_Aired.Rating | Last_Aired.Votes | Last_Aired.Thumb | Next_Aired | Next_Aired.Episode | Next_Aired.Name | Next_Aired.TMDb_ID | Next_Aired.Plot | Next_Aired.Season | Next_Aired.Thumb

There's also a wiki page now:
https://github.com/jurialmunkey/plugin.video.themoviedb.helper/wiki/Service-Monitor#properties-returned
@jurialmunkey
Great... thanks. I am on the process on re-desing the whole video info window and still on movies section. As soon as i moving on to tv shows will have a look.

By the way... a plugin:// path with the next aired episodes of the shows that are in local library will be nice.

Thanks
Nessus


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

(2019-12-08, 11:57)nessus Wrote: By the way... a plugin:// path with the next aired episodes of the shows that are in local library will be nice.

I think this might be tricky because I would need to do an individual request for each show in the library - a large library would be really slow to process.

However, you can do something similar if your library is synced with your trakt account.

Trakt section provides a TV calendar function which will show all episode airing from the start date for X amount of days:
plugin://plugin.video.themoviedb.helper/?info=trakt_calendar&startdate=0&days=1&type=episode

Set &startdate= to the number of days from today that you want to start the calendar (can be negative e.g. -1 to start from yesterday)
Set &days= to the number of days you want the calendar to span.

e.g. To get episodes airing tomorrow from shows in your trakt collection use:
plugin://plugin.video.themoviedb.helper/?info=trakt_calendar&startdate=1&days=1&type=episode

e.g. To get episodes airing for the week starting from yesterday use:
plugin://plugin.video.themoviedb.helper/?info=trakt_calendar&startdate=-1&days=7&type=episode

e.g. To get episodes that aired in the last fortnight use:
plugin://plugin.video.themoviedb.helper/?info=trakt_calendar&startdate=-14&days=14&type=episode

Still a few small bugs when TMDb doesn't have info but I'm working on a fix for those.


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

@jurialmunkey 
For some reason, when using the service monitor to get the list contianers (=discover, =with_crew, =similar etc), the Container(container_id).IsUpdating it's not working. The same applies for the String.IsEmpty(Window(Home).Property(TMDbHelper.IsUpdating)) condition.

Any idea?

(2019-12-09, 13:41)jurialmunkey Wrote: However, you can do something similar if your library is synced with your trakt account.
I don't use trakt. Is there any other way?


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

(2019-12-10, 21:04)nessus Wrote: @jurialmunkey 
For some reason, when using the service monitor to get the list contianers (=discover, =with_crew, =similar etc), the Container(container_id).IsUpdating it's not working. The same applies for the String.IsEmpty(Window(Home).Property(TMDbHelper.IsUpdating)) condition.
What do you mean by "not working"?

I'm guessing that the property is empty when you pass it to the container due to the delay between the service monitor finishing updating and kodi setting the properties in the background thread. You need to hide the container until the property has loaded:
e.g. if your content path has &with_crew=$INFO[Window(Home).Property(TMDbHelper.ListItem.Director)] then your container visibility condition needs to be:
<visible>!String.IsEmpty(Window(Home).Property(TMDbHelper.ListItem.Director)) + String.IsEmpty(Window(Home).Property(TMDbHelper.IsUpdating))</visible>

(2019-12-10, 21:04)nessus Wrote:
(2019-12-09, 13:41)jurialmunkey Wrote: However, you can do something similar if your library is synced with your trakt account.
I don't use trakt. Is there any other way?

I would essentially be recreating the Next Aired script - which still works btw.

Next Aired script works by individually making a request to an API for each show that exists in the library and then doing another request to look-up the details for each "next airing" episode for each show - so you can imagine a large library will take a long time to update. To deal with the processing time, Next Aired stores the results in a local database and then periodically updates the database.

It's definitely not something that can be done on the fly, and maintaining a periodically updated local database of next airing shows is pretty far out of the scope of my plugin.


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

You can accomplish a similar effect to Next Aired using LazyTV, if I'm not mistaken?


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

I have a small issue.

Using AZ2, with an addons widget (addons://sources/video/). If i click on tmdb helper from that widget i just get a never ending please wait loading circle. 

If I right click the widget item > information and then "run" it loads normally.


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

(2019-12-15, 20:24)dm21912 Wrote: I have a small issue.

Using AZ2, with an addons widget (addons://sources/video/). If i click on tmdb helper from that widget i just get a never ending please wait loading circle. 

If I right click the widget item > information and then "run" it loads normally.
Make sure content type of widget is set to "videos". If the content type is set to programs, kodi will try to run the script portion rather than the plugin portion.


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

(2019-12-15, 23:01)jurialmunkey Wrote: Make sure content type of widget is set to "videos"

It was set to videos. have tried switching to programs then back to videos (and tried none) but same problem.


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

(2019-12-16, 02:29)dm21912 Wrote:
(2019-12-15, 23:01)jurialmunkey Wrote: Make sure content type of widget is set to "videos"

It was set to videos. have tried switching to programs then back to videos (and tried none) but same problem.

Very strange. It works perfectly fine for me using addons://sources/video/ and content type videos - and I tested on both Windows and LibreELEC. I normally start the plugin from the widget myself, so I would notice pretty quickly if it didn't work.


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

(2019-12-16, 09:27)jurialmunkey Wrote: and I tested on both Windows and LibreELEC

yeh, this is android (firestick 4k). Was speaking to someone else on android in discord got same problem. 

weird.

its not that much of a hassle just to press info>run though


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

Is there a player placeholder for plot?


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

(2019-12-16, 20:57)dm21912 Wrote:
(2019-12-16, 09:27)jurialmunkey Wrote: and I tested on both Windows and LibreELEC

yeh, this is android (firestick 4k). Was speaking to someone else on android in discord got same problem. 

weird.

its not that much of a hassle just to press info>run though

Hmm, interesting that is happening on Android. The reason it happens is because the plugin also has script functions, so those are being run instead of the plugin section - but that shouldn't happen unless it is run from programs.

I'm looking to split up the different sections (plugin, script, service) into separate modules in the future - so when I do that it shouldn't happen anymore.


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

(2019-12-16, 21:19)drinfernoo Wrote: Is there a player placeholder for plot?

Not currently but I can add one if needed.


BTW if you add a {key} that isn't provided, the player function will just leave it blank. For instance, if you add {plot} currently it will just replace it with an empty string. I'm guessing many addons allow passing of additional metadata that isn't necessary for the look-up for the item but is just used to fill infolabels - so having an empty string shouldn't break anything (you just won't get that additional metadata). You should be able to copy pretty much any Meta url and have it work (unless it needs regex but that feels like a real corner case).


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

@jurialmunkey 
Hello again. Still working on this and on the road i have a couple questions.

So, i am trying to eliminate the need of two video info dialogs like we used to do with extendedinfo script by getting all the info from Kodi's info labels and having the themoviedb.helper info properties as fallbacks and i have a couple issues...
1. There is no ListItem.Trailer info label in the themoviedb.helper info properties. Is this not available in the API.

2. I cant fallback the main "Play" action for the item. In movies videos section i use PlayMedia($INFO[ListItem.FilenameAndPath]). In widgets using eg... plugin://plugin.video.themoviedb.helper?info=now_playing&amp;type=movie this is not working since the ListItem.FilenameAndPath is empty for all items even for those are available in local library. I try to you use themoviedb.helper play fuction... plugin://plugin.video.themoviedb.helper?info=play&amp;tmdb_id=$INFO[ListItem.Property(tmdb_id)]&amp;type=movie but that it's not working too. I am sure i am doing something wrong here but i cant figure what?.

Any idea?