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.
(2023-07-09, 11:44)Hitcher Wrote: [ -> ]Simply because this is a totally separate window that replicates the 'TV Show Next Aired' addon and isn't accessed via themoviedb.helper.
...
So the themoviedb.helper Next Aired Library layout will still stack episodes if the user enables it.

I'm not worried about a skin changing the behaviour, I just don't understand the broader justification for overriding the user's preference.

Why wouldn't you want to allow the user the choice? Does stacking break something in the skin? What problem does overriding user choice solve here?

I'm asking because I want to better understand the problem. There might be a better solution than a setting override.

(2023-07-09, 11:44)Hitcher Wrote: [ -> ]Weirdly it's now working this morning so there must be some delay when changing regional settings.

Calendar results are cached for 6 hours, so it won't change until next refresh.

(2023-07-09, 11:44)Hitcher Wrote: [ -> ]That has no effect because it's not using themoviedb.helper Next Aired Library views.

Shouldn't matter. The setting is always applied if enabled. Doesn't matter where a plugin is called, if the plugin:// path is the same then it executes the same code.

Note that it won't update immediately due to cached results. I added a fix for next release to refresh the cache if the setting changes.
(2023-07-10, 11:48)jurialmunkey Wrote: [ -> ]I'm not worried about a skin changing the behaviour, I just don't understand the broader justification for overriding the user's preference.

Why wouldn't you want to allow the user the choice? Does stacking break something in the skin? What problem does overriding user choice solve here?

I'm asking because I want to better understand the problem. There might be a better solution than a setting override.
Not breaking I'm not sure how elegantly I can display the title and plot if there are multiple episodes stacked -

Image

(2023-07-10, 11:48)jurialmunkey Wrote: [ -> ]Calendar results are cached for 6 hours, so it won't change until next refresh.

Shouldn't matter. The setting is always applied if enabled. Doesn't matter where a plugin is called, if the plugin:// path is the same then it executes the same code.

Note that it won't update immediately due to cached results. I added a fix for next release to refresh the cache if the setting changes.
Thanks.
Never mind, I think this is adequate.

Image
(2023-07-09, 10:22)jurialmunkey Wrote: [ -> ]ListItem.Property(tvshow.dbid) will give you the base tvshow library DBID as long as you have enabled the option to retrieve Kodi database details in settings (it's an option for performance reasons for users with large libraries - so it's not something that can be forced by a skin).

xml:
<onclick>ActivateWindow(videos,videodb://tvshows/titles/$INFO[Container(ID).ListItem.Property(tvshow.dbid)]/,return)</onclick>
Is there a way to know whether the user has this option enabled so I can make this action conditional otherwise to just opens the TV show library?

Thanks.
(2023-07-13, 13:32)Hitcher Wrote: [ -> ]
(2023-07-09, 10:22)jurialmunkey Wrote: [ -> ]ListItem.Property(tvshow.dbid) will give you the base tvshow library DBID as long as you have enabled the option to retrieve Kodi database details in settings (it's an option for performance reasons for users with large libraries - so it's not something that can be forced by a skin).

xml:
<onclick>ActivateWindow(videos,videodb://tvshows/titles/$INFO[Container(ID).ListItem.Property(tvshow.dbid)]/,return)</onclick>
Is there a way to know whether the user has this option enabled so I can make this action conditional otherwise to just opens the TV show library?

Thanks.

If it's only for onclick condition then why not simply check the ListItem values...? e.g.

xml:

<onclick condition="!String.IsEmpty(Container(ID).ListItem.Property(tvshow.dbid)) + String.StartsWith(Container(ID).ListItem.FolderPath,plugin://)">
<onclick condition="String.IsEmpty(Container(ID).ListItem.Property(tvshow.dbid)) + String.StartsWith(Container(ID).ListItem.FolderPath,plugin://)">

If it doesn't have a DBID then retrieving Kodi DB is disabled.
If it has a plugin:// folder path then either Kodi DB or link library option is disabled.

If both options are enabled it will have a videodb:// folderpath.
Sometimes the answer is so obvious you can't see it! Rolleyes

Thanks.
I understand this section is meant for skinners and I definitely am not one. However I think my problem relates to the "plugin.video.themoviedb.helper" so please hear me out. I have several video categories eg. sports (AFL) and home videos that I have been keeping out of my Kodi Library but am keen to have them scanned in now. I know they will not be picked up by scanners like TMDb TV Shows so I have created my own NFO files.

When I use the default Kodi skin or skins that don't require the "plugin.video.themoviedb.helper" and scan these videos into Kodi Library, I select TV shows and then "Local information only" and everything scans fine. The videos are in the library with the titles I have put in the NFO. However jurialmunkey's skins are my favourite and recently have been trying the Arctic Horizon 2. The main issue is that some of those videos that I previously have scanned with my local NFO now show up with different titles and plots and I suspect it is related to "plugin.video.themoviedb.helper".

For example, I have some AFL (Australian Rules Football) games I transferred from DVD to put on Kodi. However it now shows as "Fatoota - Al Aflam - Fawazeer, an exhibition in which Samoura performs a scene from an old movie in every episode, and it is required to know the name of the movie every time". If I try and rescan it again with again only local information selected, it flashes "TMDbHelper Tagger Updating".

Any advise on what I am doing wrong.
@satelly - TMDbHelper doesn't touch your library info. TMDbHelper only does online lookups which the skin can decide to use to supplement local information.

The issue here is that sports aren't really "tv shows" in the sense of being a series with seasons and episodes. Because these are listed as tvshows, TMDbHelper is trying its best to find a matching tvshow on TMDb and that's the best match available based on the metadata given.

The skin is then using that metadata TMDbHelper provides. Attempting to rescrape "local information only" isn't going change anything because TMDbHelper is separate from your library.

No real good solution here. Kodi doesn't have an appropriate separate "videos" library for content like this which doesn't fit into tvshows or movies. The current expectation is that this type of content is left as files.
Thanks jurialmunkey for the reply and explanation. I now understand what is happening. It sounds like an important part of your skins but is it possible at all for me  to try and disable it.  When I try to do it in the Kodi add-on section, it doesn't allow it as it is linked to your skin.
hi @jurialmunkey - I'm having some problems using your awesome plugin to populate one of the widgets on my infoscreen. My aim for this particular widget is to use the studio of the listitem to display more shows from that studio. I'm not sure if this is an issue on my end, so I wanted to ask here if you or anyone else sees the correct information being returned in the following two scenarios:

xml:

<value>plugin://plugin.video.themoviedb.helper?info=discover&type=tv&with_companies=HBO</value>

This works and shows me 20 HBO shows from this page: https://www.themoviedb.org/network/49-hbo

However, if I try with AMC for example, I don't get any results. I chose AMC because it is another name with lots of shows and without without any potential formatting issues like spaces or + signs, as I thought at first maybe this was this issue. I would expect to see shows from this page: https://www.themoviedb.org/network/174

xml:

<value>plugin://plugin.video.themoviedb.helper?info=discover&type=tv&with_companies=AMC</value>

As a secondary question, with the HBO example, it works, but should my container sort method come into play or is this dictated by the plugin? I have it set to random, but I notice the shows on the first page always seem to be the same 20, just in a different order. If I set to something else such as name, the order stays consistent between restarts but not in alphabetical (e.g. first three shows are Euphoria, The Last Of Us, House of the Dragon)

Edit: Looking more at the data on TheMovieDB, I think maybe I'm mixing studios and networks. AMC doesn't have any results potentially because there are a bunch of companies with that name and in fact, the first one is AMC (ES) which only has one credit, a film. Which would explain why I don't see any results when filtering by TV shows. I think that's probably where I've gone wrong!

Edit2: And now I see your note about this in the Wiki. Apologies for the unnecessary question! https://github.com/jurialmunkey/plugin.v...ailed-Item
@realcopacetic - Yeah you're mixing up networks (the broadcaster) and companies (the studio)
-- HBO is both a studio and a broadcaster hence why it works. You're actually getting the results from the company page not the network: https://www.themoviedb.org/company/3268-hbo/tv

FYI, you can do "with_networks=174" but you need to know the ID because TMDb API doesn't have a way to search for a network (whereas it does have an endpoint to search a company so you can use a name for with_companies= and discover will search for the ID for you).
Something changed with this addon regarding trakt lists. When I click on a list that is supposed to show episodes I see the TV show, or season, as one entry in the list and can no longer see individual lists. 
This
Image
Now looks like this:
Image

I did not change a setting and noticed the add-on was updated.  I verifed the list did not change and, in fact, every list I searched for behaved like this.
(2023-08-14, 01:35)htpc-mac Wrote: [ -> ]Something changed with this addon regarding trakt lists. When I click on a list that is supposed to show episodes I see the TV show, or season, as one entry in the list and can no longer see individual lists. 
This
Image
Now looks like this:
Image

I did not change a setting and noticed the add-on was updated.  I verifed the list did not change and, in fact, every list I searched for behaved like this.

If this is the same issue I think it is, then I might've already fixed this yesterday

Can you try v5.1.33 (latest version) and confirm if it is working correctly now?
https://github.com/jurialmunkey/plugin.v...ag/v5.1.33
That fixed it, thanks!
(2023-08-14, 06:27)htpc-mac Wrote: [ -> ]That fixed it, thanks!

@jurialmunkey It is broken again. This time, the recently updated, script.module.jurialmunkey is throwing up error codes

Code:
 [script.module.jurialmunkey]JSONRPC Error:
                                                   {'jsonrpc': '2.0', 'method': 'VideoLibrary.GetTVShowDetails', 'id': 1, 'params': {'tvshowid': 1005, 'properties': ['title', 'genre', 'year', 'rating', 'plot', 'studio', 'mpaa', 'cast', 'playcount', 'episode', 'imdbnumber', 'premiered', 'votes', 'lastplayed', 'fanart', 'thumbnail', 'file', 'originaltitle', 'sorttitle', 'episodeguide', 'season', 'watchedepisodes', 'dateadded', 'tag', 'art', 'userrating', 'ratings', 'runtime', 'uniqueid']}}
                                                   {'error': {'code': -32602, 'message': 'Invalid params.'}, 'id': 1, 'jsonrpc': '2.0'}

I use skin helper to find the page where I am currently (kodi loads the page than applies watched filter which means a lot of empty pages), use autowidget to make a widget of that and use the skin to feature the widget. When I use autowidget to do that script.module.jurialmunkey starts throwing up error codes.