Kodi Community Forum

Full Version: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Inside the skin it's not possible, yes. It would be nice to have a info label like ListItem.UniqueID(foo).
I'll ask @ronie for a  possible implementation.

I dunno how you are checking against the local DB, but I do request all items in the initalization with a limited set of all items (costs me 1s, then it's cached). 
And for script calls I've added an option to use the DBID + DBType so the script will try to get the imdb id from the uniqueid table by itself.
(2020-02-07, 08:25)sualfred Wrote: [ -> ]Inside the skin it's not possible, yes. It would be nice to have a info label like ListItem.UniqueID(foo).
I'll ask @ronie for a  possible implementation.

I dunno how you are checking against the local DB, but I do request all items in the initalization with a limited set of all items (costs me 1s, then it's cached). 
And for script calls I've added an option to use the DBID + DBType so the script will try to get the imdb id from the uniqueid table by itself.

Yeah it really is only from the skin side of things that it's an issue. I don't actually use local data for any lookups - I get online info first and then use that to search for a matching local item from jsonrpc (I check against imdb id first and then if no matches use title). I only merge dbid, artwork, filenamepath and streaminfo from local (everything else is online).

For the kodi db lookups I don't actually cache anything - i figure a local lookup with a list comprehension of matches is pretty quick and the slight performance cost is worth it to ensure I get the most recent info from local db. (it would be a pain if user had refreshed the library and so my cached dbid or file path didn't match anymore with their library)
In my usecase it was a lot faster to get all items all in once and to use the data as long as embuary info is active, but your addon has much more implementaiton scenarios. A caching would still be possible. All that is required is a small service in the background which is listening on VideoLibrary.OnScanFinished / .OnCleanFinished to refresh the cached data. Anyway, if you don't have any performance penalties this is not required at all Smile

But for the skin side of things you always can use the dbid + dbtype to get the uniqueid. But I 100% agree: A direct access to something like ListItem.UniqueID(imdb) would be a much better solution. It could also be used for skins and ID representation in info dialogs etc. Or for calls in other scripts and addons.
@jurialmunkey Hi there... again.

I would to ask you for an addition, if it's possible, in the addon's provided widgets lists. I was using a widget list provided by Marcel's script.skin.helper.widgets which was a list of all the Next Aired episodes for TV Shows that are in the library. Is it possible to get that kind list with the TMDB helper?

Thanks
Nessus
(2020-02-15, 20:52)nessus Wrote: [ -> ]@jurialmunkey Hi there... again.

I would to ask you for an addition, if it's possible, in the addon's provided widgets lists. I was using a widget list provided by Marcel's script.skin.helper.widgets which was a list of all the Next Aired episodes for TV Shows that are in the library. Is it possible to get that kind list with the TMDB helper?

Thanks
Nessus
I think you asked about this before.

Short answer is only with a trakt account.

Skinhelper is integrated with next aired script (which is no longer maintained afaik). I would essentially need to recreate the next aired script - have something which scans the library for shows on a regular basis and then maintain a cached database of next aired dates.

Really it is something for a separate script. Maintaining a local db is not really what this plugin is about - whilst I do cache some results, everything should work live without needing previously cached details. It's not possible to do next aired live because you would need to make requests for every single show in your library, which would take a long time.

If you have a trakt account, the plugin has a trakt calendar section.
(2020-02-15, 22:48)jurialmunkey Wrote: [ -> ]I think you asked about this before.

Short answer is only with a trakt account.
Sorry about that. I didn't remember that asked about this before.

I don't have a trakt account and in fact it's not for my personal use. I had suggested this list to Marcel (and he has add it) when he was maintaining his scripts because i think it's a useful list to have. But if it's to much trouble then leave it. I will keep it depending on Marcel's script until will no longer work.

Thanks
Nessus
It is possible, but not a one liner.

https://api.themoviedb.org/3/tv/airing_today or /on_the_air
->
for each result get tvdb/imdb by using http://api.themoviedb.org/3/tv/{show_id} + appending of external ids
->
for each external ID check if it's part of the library
->
use next_episode_to_air result

Edit:
I already thought about adding it to my addon, but since we Germans always have to wait ~1 year until a season arrives here in our country ¯\_(ツ)_/¯...
Jurial is right. A successor of the Next Aired Script is probably the better solution.
(2020-02-16, 21:47)nessus Wrote: [ -> ]
(2020-02-15, 22:48)jurialmunkey Wrote: [ -> ]I think you asked about this before.

Short answer is only with a trakt account.
Sorry about that. I didn't remember that asked about this before.

I don't have a trakt account and in fact it's not for my personal use. I had suggested this list to Marcel (and he has add it) when he was maintaining his scripts because i think it's a useful list to have. But if it's to much trouble then leave it. I will keep it depending on Marcel's script until will no longer work.

Thanks
Nessus

@nessus - Please test latest version from git.
TMDbHelper > TvShows > Next Aired Library

It is quite slow to load since it needs to make so many requests (lookup kodi library, get tmdb_ids for each item, lookup details for each item, then filter the list and sort it), but it does work.

Better performance would require some type of Next Aired script with a proper database of shows.

It currently shows anything with a next aired date sorted in order of dates - does it need a date cut-off (e.g. next fortnight) ?
@jurialmunkey 
Perfect!. Just tested and it's working great. It took about 10 secs to load. It's totally fine.

The only thing that i would like to ask if is possible to set the dbtype to "episode" (now is as "tvshow") since my infolabels for that list are for set for episodes info wich IMHO make more sense. Also i didnt see any of the other infolabels that i am using there like air day, air time & studio except if it needs some changes to my infolabels code.

This is the extra infolabels that i am using...
xml:
$INFO[Container(25).ListItem.Property(AirDay)]
$INFO[Container(25).ListItem.Property(AirDate)]
$INFO[Container(25).ListItem.Property(AirTime)]
$INFO[Container(25).ListItem.Studio]

...and this is the visual result...

Image

Thanks a lot for this. It's a great addition.

Cheers
Nessus
Just wondering the data this provides does it fetch it new Everytime or are you storing it locally?
(2020-02-17, 22:32)nessus Wrote: [ -> ]@jurialmunkey 
Perfect!. Just tested and it's working great. It took about 10 secs to load. It's totally fine.

The only thing that i would like to ask if is possible to set the dbtype to "episode" (now is as "tvshow") since my infolabels for that list are for set for episodes info wich IMHO make more sense. Also i didnt see any of the other infolabels that i am using there like air day, air time & studio except if it needs some changes to my infolabels code.

This is the extra infolabels that i am using...
xml:
$INFO[Container(25).ListItem.Property(AirDay)]
$INFO[Container(25).ListItem.Property(AirDate)]
$INFO[Container(25).ListItem.Property(AirTime)]
$INFO[Container(25).ListItem.Studio]

...and this is the visual result...

Image

Thanks a lot for this. It's a great addition.

Cheers
Nessus
Please test latest. Now uses episode type. Air date is now set to listitem.premiered in addition to the normal listitem.property(next_aired)

Properties are the same as a normal tvshow - see the wiki. You can get both next_aired and last_aired properties as you would with any tvshow.
https://github.com/jurialmunkey/plugin.v...w-specific

You should be able to get listitem.studio

I can add a next aired day of week if you like. However air time will require an additional lookup - how essential is airtime? Because it will add loading time (extra lookup per item in list)
Thanks. Episode type it's working fine.
If it's not much trouble, so the infoline to be complete, can you please also add the air-day of the week and the air-time, or if it's easier for you, you can combine all three values (date, day & time) to one list item property. Something like... ListItem.Property(NextAired_Libray)

Thanks
Nessus
(2020-02-17, 23:26)smitchell6879 Wrote: [ -> ]Just wondering the data this provides does it fetch it new Everytime or are you storing it locally?
The plugin caches lists for 1 day, and details about items for 14 days. Caching duration can be extended in the plugin settings.

Details from the library are not cached and are retrieved "live" everytime (they are essentially cached anyway since it is local info)

For this next aired list, the detailed data cache is refreshed once a day since info can change.
I'm having an issue with trakt reporting the wrong show as watched. If I use add to trakt history from the context, or after watching. Trakt is reporting the wrong show. In this case I was trying to watch forged in fire (TV show) if I watch an episode it reports to trakt as how I met your mother. If I check add to trakt history from the context, it adds the entire wwe smackdown to my history (All 1200 episodes)

Log: https://pastebin.com/1Wvgyy4F
Pic: https://imgur.com/a/QRKAoG3
(2020-02-18, 02:13)DoSe420 Wrote: [ -> ]I'm having an issue with trakt reporting the wrong show as watched. If I use add to trakt history from the context, or after watching. Trakt is reporting the wrong show. In this case I was trying to watch forged in fire (TV show) if I watch an episode it reports to trakt as how I met your mother. If I check add to trakt history from the context, it adds the entire wwe smackdown to my history (All 1200 episodes)

Log: https://pastebin.com/1Wvgyy4F
Pic: https://imgur.com/a/QRKAoG3
Tmdbhelper doesn't report what you've watched to trakt after playing - thats handled either by trakt addon or the addon used to play with.

Context menu is concerning though. Are you using the latest git version? I thought I already fixed this issue with the wrong trakt slug being retrieved for tv.

If you're using latest git, please provide a debug log. Make sure to also turn debug logging on inside tmdbhelper settings