Release plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners
(2019-08-31, 02:31)jurialmunkey Wrote:
(2019-08-31, 01:26)bsoriano Wrote: On another note, would you consider adding a discover call for tv shows for year? I know the API call is slightly different for tv shows, since it is not primary_release_year the field in the discover call for tv shows.  If you would add it, it would allow me to also show more tv shows from the same year as the current one in the video info dialog.

You should already be able to:
Code:
plugin://plugin.video.themoviedb.helper?info=discover&type=tv&first_air_date_year=$INFO[ListItem.Year]

Any additional param given to the discover plugin path will be passed to the api call, so you should be able to use pretty much anything here. You can even combine the params.
https://developers.themoviedb.org/3/disc...e-discover
https://developers.themoviedb.org/3/disc...v-discover

The only ones that are tricky are when they require translating into a tmdb_id (e.g. can't just pass a plain text genre to the api). For most of those though, I've provided functions in the plugin to translate into the correct IDs.

You should be able to use any combo of the following (as long is it is supported by the type of discover request):
with_genres
without_genres
with_companies
with_people
with_crew
with_cast
sort_by
first_air_date_year
vote_average.gte
vote_average.lte
vote_count.gte
vote_count.lte
with_runtime.gte
with_runtime.lte
primary_release_year

It should also be possible to use date queries (e.g. primary_release_date.gte). However, I'm not 100% on the date format that TMDb expects and whether it changes based on country code, so it might not always work - particularly as kodi also changes date format based upon region/country. If the date functions are desired I can look at translating dates into the appropriate format too. However, I haven't found much need for these, as I mostly want year filters instead. 
@jurialmunkey , thank you very much, it works great.

I am seeing an issue I have not been able to figure out, perhaps you can help me.

If I press i on a movie or tv show (my skin setting to look info online in tmdb is set to true), and click on any movie or tv show from a custom list (say similar, or recommended), and then click on a cast member, I get a select dialog to look online in tmdb or look in the local database, and immediately get a plugin.video.themoviedb.helper error in the log:

html:

2019-08-31 12:12:18.117 T:18446744073709551614   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ValueError'>
                                            Error Contents: Invalid paramstring - Must specify info and type: info=similar&&query=Search online in TMDb!
                                            Traceback (most recent call last):
                                              File "C:\Users\bsori\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\plugin.py", line 12, in <module>
                                                Container().router()
                                              File "C:\Users\bsori\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\resources\lib\container.py", line 308, in router
                                                raise ValueError('Invalid paramstring - Must specify info and type: {0}!'.format(self.paramstring))
                                            ValueError: Invalid paramstring - Must specify info and type: info=similar&&query=Search online in TMDb!
                                            -->End of Python script error report<--
2019-08-31 12:12:18.725 T:18446744073709551614   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ValueError'>
                                            Error Contents: Invalid paramstring - Must specify info and type: info=recommendations&&query=Search online in TMDb!
                                            Traceback (most recent call last):
                                              File "C:\Users\bsori\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\plugin.py", line 12, in <module>
                                                Container().router()
                                              File "C:\Users\bsori\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\resources\lib\container.py", line 308, in router
                                                raise ValueError('Invalid paramstring - Must specify info and type: {0}!'.format(self.paramstring))
                                            ValueError: Invalid paramstring - Must specify info and type: info=recommendations&&query=Search online in TMDb!
                                            -->End of Python script error report<--
2019-08-31 12:12:18.745 T:18446744073709551614   ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.themoviedb.helper/?info=similar&&query=Search online in TMDb
2019-08-31 12:12:18.787 T:18446744073709551614   ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.themoviedb.helper/?info=recommendations&&query=Search online in TMDb
2019-08-31 12:12:18.792 T:18446744073709551614  NOTICE: [plugin.video.themoviedb.helper]
                                            Requesting... https://api.themoviedb.org/3/discover/No...ternal_ids
2019-08-31 12:12:19.116 T:18446744073709551614   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ValueError'>
                                            Error Contents: Invalid paramstring - Must specify info and type: info=crew&&query=Search online in TMDb!
                                            Traceback (most recent call last):
                                              File "C:\Users\bsori\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\plugin.py", line 12, in <module>
                                                Container().router()
                                              File "C:\Users\bsori\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\resources\lib\container.py", line 308, in router
                                                raise ValueError('Invalid paramstring - Must specify info and type: {0}!'.format(self.paramstring))
                                            ValueError: Invalid paramstring - Must specify info and type: info=crew&&query=Search online in TMDb!
                                            -->End of Python script error report<--
2019-08-31 12:12:19.164 T:18446744073709551614   ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.themoviedb.helper/?info=crew&&query=Search online in TMDb
2019-08-31 12:12:19.508 T:18446744073709551614  NOTICE: [plugin.video.themoviedb.helper]
                                            HTTP Error Code: 404

It's as if in the background the plugin is trying to refresh the similar, recommended and crew custom lists, but while the select dialog is open, ListItem.Label is no longer the movie/tv show title, but the option in the select dialog.  Any idea how I could get around this? My code is updated in the master branch of Amber in GitHub.

Thank you so much for your help.

Regards,

Bart
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 bsoriano - 2019-08-31, 18:21
Logout Mark Read Team Forum Stats Members Help
plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners2