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 - bsoriano - 2019-08-25

(2019-08-25, 03:04)jurialmunkey Wrote:
(2019-08-24, 16:51)bsoriano Wrote: Unfortunately, I could not get it to work yet.  I added the visibility conditions, the fade animation and the additional value in the cast list variables.  What happens is that if any cast info list is empty, it will not show, but it also will not show the previous one. 

Works fine for me when I uncomment out the lines in DialogVideoInfo and the variables.
All I had to do was move your Control.IsVisible(9101) visibility conditions to the parent group.
This PR works for me:
https://github.com/bartolomesoriano/skin.amber/pull/6
(2019-08-24, 16:51)bsoriano Wrote: Thanks for the additional window props.  They do not seem to be working fine. NumTMDBItems always is 1, and NumDBIDItems is always 0.
I can't see anywhere that you've actually added the additional param to the path?
Also, it shouldn't be possible for NumDBIDItems to be 0 as I don't add the property if the value is not > 0 
@jurialmunkey , once again, thank you so much!! With that change, works great! Smile 

As for the window props, in the TMDBCastItem onclick I am adding the additional param like so:

xml:

<include name="TMDBCastItem">
        <param name="CastListItemID" />
        <definition>
            <item>
                <label>$INFO[Container(5100).ListItemAbsolute(1).Property(Cast.$PARAM[CastListItemID].Name)]</label>
                <label2>$INFO[Container(5100).ListItemAbsolute(1).Property(Cast.$PARAM[CastListItemID].Role)]</label2>
                <icon>$INFO[Container(5100).ListItemAbsolute(1).Property(Cast.$PARAM[CastListItemID].Thumb)]</icon>
                <visible>!String.IsEmpty(Container(5100).ListItemAbsolute(1).Property(Cast.$PARAM[CastListItemID].Name))</visible>
                <onclick>RunScript(plugin.video.themoviedb.helper,add_path=plugin://plugin.video.themoviedb.helper/?info=details&amp;type=person&amp;query=$INFO[Container(5100).ListItemAbsolute(1).Property(Cast.$PARAM[CastListItemID].Name)]&amp;prop_id=TMDbTotals,call_id=1129,prevent_del)</onclick>
            </item>
        </definition>
    </include>

And in the person info dialog I am then displaying them like this:

xml:

<item>
                            <label>Total Media in TMDb:</label>
                            <label2>$INFO[Window(Home).Property(TMDBHelper.TMDbTotals.NumTMDBItems)]</label2>
                            <onclick>noop</onclick>
                            <visible>!String.IsEmpty(Window(Home).Property(TMDBHelper.TMDbTotals.NumTMDBItems))</visible>
                        </item>
                        <item>
                            <label>Total in local Database:</label>
                            <label2>$INFO[Window(Home).Property(TMDBHelper.TMDbTotals.NumDBIDItems)]</label2>
                            <onclick>noop</onclick>
                            <visible>!String.IsEmpty(Window(Home).Property(TMDBHelper.TMDbTotals.NumDBIDItems))</visible>
                        </item>

I apologize I was not specific enough, NumDBID items is not 0, it is always empty, thus I never see it displayed.

Regards,

Bart


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

@bsoriano - You need to add the prop_id param to the actual list that you want the stats for, not the detailed item. That's where you are going wrong. You are getting either 1 or 0 because there is only one movie/tvshow/person in the detailed item list - the actual movie/tvshow/person that you are looking up the details for.


For instance, getting similar movies with:
xml:
plugin://plugin.video.themoviedb.helper/?info=similar&amp;type=movie&amp;imdb_id=$INFO[ListItem.IMDBNumber]&amp;prop_id=SimilarMovies

I can then get the number of items in the similar list that are also in my library with:
xml:
$INFO[Window(Home).Property(TMDbHelper.SimilarMovies.NumDBIDItems)]

I haven't tested, but you should be able to add it to the folderpath of the 9999 listitems:
xml:
$INFO[Container(9999).ListItemAbsolute(1).FolderPath,,&amp;prop_id=CastMovies]

I can't get totals for all lists because I don't know which lists will be used (whereas extended info forces you to use all its lists). I can only get the totals for individual lists.


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

(2019-08-25, 04:37)jurialmunkey Wrote: @bsoriano - You need to add the prop_id param to the actual list that you want the stats for, not the detailed item. That's where you are going wrong. You are getting either 1 or 0 because there is only one movie/tvshow/person in the detailed item list - the actual movie/tvshow/person that you are looking up the details for.


For instance, getting similar movies with:
xml:
plugin://plugin.video.themoviedb.helper/?info=similar&amp;type=movie&amp;imdb_id=$INFO[ListItem.IMDBNumber]&amp;prop_id=SimilarMovies

I can then get the number of items in the similar list that are also in my library with:
xml:
$INFO[Window(Home).Property(TMDbHelper.SimilarMovies.NumDBIDItems)]

I haven't tested, but you should be able to add it to the folderpath of the 9999 listitems:
xml:
$INFO[Container(9999).ListItemAbsolute(1).FolderPath,,&amp;prop_id=CastMovies]

I can't get totals for all lists because I don't know which lists will be used (whereas extended info forces you to use all its lists). I can only get the totals for individual lists.

@jurialmunkey , thanks again! I will try this tomorrow. I will add a prop to each list and them add them together to show the total. I will let you know how it goes.

Regards,

Bart

EDIT: @jurialmunkey , the props work great added to the lists.  Thanks again! Smile


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

@jurialmunkey, I noticed an issue today that I am posting here instead of in the Arctic Zephyr 2 forum, since I think it is related to the addon. Using your skin, if I go into the info dialog for a movie and then click on a movie that is in the local db from the first custom info list (say, movies that are in the same set, or from the same director) then I get the busy spinner, but I never get the info dialog for the other movie. I am using the latest Matrix nightly if that makes a difference.

Any idea why this could be happening?

Thanks for your help.

Regards,

Bart

EDIT: Nevermind @jurialmunkey , it must have been a glitch or issue with tmdb, I cannot replicate this again today.


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

(2019-08-30, 04:53)bsoriano Wrote: @jurialmunkey, I noticed an issue today that I am posting here instead of in the Arctic Zephyr 2 forum, since I think it is related to the addon. Using your skin, if I go into the info dialog for a movie and then click on a movie that is in the local db from the first custom info list (say, movies that are in the same set, or from the same director) then I get the busy spinner, but I never get the info dialog for the other movie. I am using the latest Matrix nightly if that makes a difference.

Any idea why this could be happening?

Thanks for your help.

Regards,

Bart

EDIT: Nevermind @jurialmunkey , it must have been a glitch or issue with tmdb, I cannot replicate this again today.

Yeah I can't recreate the issue.

Either way, in AZ2 I don't use TMDb for local items. I do a search for them in the local library using the following content path:
Code:
$INFO[ListItem.Label,videodb://movies/titles/?xsp=%7B%22order%22%3A%7B%22direction%22%3A%22ascending%22%2C%22ignorefolders%22%3A0%2C%22method%22%3A%22sorttitle%22%7D%2C%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22title%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22,%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D]

Which translates as:
Code:
videodb://movies/titles/?xsp={"order":{"direction":"ascending","ignorefolders":0,"method":"sorttitle"},"rules":{"and":[{"field":"title","operator":"is","value":["$INFO[ListItem.Label]"]}]},"type":"movies"}

So basically it is a content path that is a smart playlist looking for items with a title that matches ListItem.Label of the list that was clicked on. So I use my script function to set that path to the "TMDbHelper.Path.Current" window property and call my custom window 1136. Once the container in my custom window updates, I do an Action(Info) to pull up the info dialog. That trick is what allows me to transition seamlessly between local and online info.


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

(2019-08-31, 01:01)jurialmunkey Wrote:
(2019-08-30, 04:53)bsoriano Wrote: @jurialmunkey, I noticed an issue today that I am posting here instead of in the Arctic Zephyr 2 forum, since I think it is related to the addon. Using your skin, if I go into the info dialog for a movie and then click on a movie that is in the local db from the first custom info list (say, movies that are in the same set, or from the same director) then I get the busy spinner, but I never get the info dialog for the other movie. I am using the latest Matrix nightly if that makes a difference.

Any idea why this could be happening?

Thanks for your help.

Regards,

Bart

EDIT: Nevermind @jurialmunkey , it must have been a glitch or issue with tmdb, I cannot replicate this again today.

Yeah I can't recreate the issue.

Either way, in AZ2 I don't use TMDb for local items. I do a search for them in the local library using the following content path:
Code:
$INFO[ListItem.Label,videodb://movies/titles/?xsp=%7B%22order%22%3A%7B%22direction%22%3A%22ascending%22%2C%22ignorefolders%22%3A0%2C%22method%22%3A%22sorttitle%22%7D%2C%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22title%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22,%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D]

Which translates as:
Code:
videodb://movies/titles/?xsp={"order":{"direction":"ascending","ignorefolders":0,"method":"sorttitle"},"rules":{"and":[{"field":"title","operator":"is","value":["$INFO[ListItem.Label]"]}]},"type":"movies"}

So basically it is a content path that is a smart playlist looking for items with a title that matches ListItem.Label of the list that was clicked on. So I use my script function to set that path to the "TMDbHelper.Path.Current" window property and call my custom window 1136. Once the container in my custom window updates, I do an Action(Info) to pull up the info dialog. That trick is what allows me to transition seamlessly between local and online info. 
@jurialmunkey, thanks! 

I have adapted your code to do as you mention, and it certainly works great.  

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.

Thank you for considering my request.

Regards,

Bart


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

(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&amp;type=tv&amp;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/discover/movie-discover
https://developers.themoviedb.org/3/discover/tv-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.


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

(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&amp;type=tv&amp;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/discover/movie-discover
https://developers.themoviedb.org/3/discover/tv-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/None?api_key=5e54cbb01927216a9583925bec1bf265&language=en-US&include_image_language=en,null&with_genres=18%2C53&append_to_response=credits,images,release_dates,content_ratings,external_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


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

@jurialmunkey , three other things I have noticed:

1. Is it possible to not include the movie or tv show you have focused in the info dialog in the searches in tmdb? it usually appears in the also directed by, recommended, from the same studio, etc.

2. How could you list the items that you have in your db first, and then the online ones? I tried putting sortby="DBID" in the <content>, but that did not work.

3. Since my collection is large, I have quite a few movies for which there are two or more with the same name.  Would you consider extending the code with which you determine if a movie is in the local db by also using the year as well as the name? That way, at least in my use case, I would not get a lot of mis-identified movies (for example, I have 4 Robin Hood movies, and since the plugin call returns the first one (I think), a lot of times it is the incorrect one.)

Thank you for taking a look at these and considering my requests.

Regards,

Bart


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

(2019-08-31, 18:21)bsoriano Wrote: 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:

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.

I've noticed this issue too - can get it by pulling up the power menu. It seems to be a Kodi bug because ListItem.Label shouldn't change whilst in DialogVideoInfo and it definitely shouldn't become the label of a modal dialog. The bug would cause issues for any plugin where ListItem.Label is passed to it.

In terms of the actual error raised by TMDbHelper - that can safely be ignored. I only raise the error to get the notification and traceback for debugging purposes. In the final version I won't raise the error and it will just be a single line in the log (without the traceback or error notification in Kodi) because it isn't actually a serious issue.


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

(2019-08-31, 20:41)bsoriano Wrote: 1. Is it possible to not include the movie or tv show you have focused in the info dialog in the searches in tmdb? it usually appears in the also directed by, recommended, from the same studio, etc.
I can add a function that is basically the reverse of filter_key/filter_value. Something like exclude_key/exclude_value:
Code:
&amp;exclude_key=title&amp;exclude_value=$INFO[ListItem.Title]
I'll let you know once I add it.

(2019-08-31, 20:41)bsoriano Wrote: 2. How could you list the items that you have in your db first, and then the online ones? I tried putting sortby="DBID" in the <content>, but that did not work.
I don't know of any specific sort method for dbid.
An option to put dbid items first in the list is definitely on my todo list though!

(2019-08-31, 20:41)bsoriano Wrote: 3. Since my collection is large, I have quite a few movies for which there are two or more with the same name.  Would you consider extending the code with which you determine if a movie is in the local db by also using the year as well as the name? That way, at least in my use case, I would not get a lot of mis-identified movies (for example, I have 4 Robin Hood movies, and since the plugin call returns the first one (I think), a lot of times it is the incorrect one.)
I was checking against imdb_id first but I've just realised that the tmdb lists don't actually return imdb id - it's only in the detailed item which is a real pain.
Yes, I'll add some additional checks for year as I've also noticed these false positives. It is probably better to miss a match occasionally than have an incorrect match.


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

(2019-09-01, 00:48)jurialmunkey Wrote:
(2019-08-31, 18:21)bsoriano Wrote: 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:

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.

I've noticed this issue too - can get it by pulling up the power menu. It seems to be a Kodi bug because ListItem.Label shouldn't change whilst in DialogVideoInfo and it definitely shouldn't become the label of a modal dialog. The bug would cause issues for any plugin where ListItem.Label is passed to it.

In terms of the actual error raised by TMDbHelper - that can safely be ignored. I only raise the error to get the notification and traceback for debugging purposes. In the final version I won't raise the error and it will just be a single line in the log (without the traceback or error notification in Kodi) because it isn't actually a serious issue.

@jurialmunkey, thanks for the explanation. I will ignore the error then. My problem in the scenario, apart from the error, is that my custom search window for searching in the local db will not open (or closes immediately) in this case. I am not sure why this happens, I have not been able to find anything in the code. I thought there might be something with the onback functions and deleting the path, but I have not managed to find the cause.

Regards,

Bart


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

(2019-09-01, 01:12)jurialmunkey Wrote:
(2019-08-31, 20:41)bsoriano Wrote: 1. Is it possible to not include the movie or tv show you have focused in the info dialog in the searches in tmdb? it usually appears in the also directed by, recommended, from the same studio, etc.
I can add a function that is basically the reverse of filter_key/filter_value. Something like exclude_key/exclude_value:
Code:
&amp;exclude_key=title&amp;exclude_value=$INFO[ListItem.Title]
I'll let you know once I add it.

(2019-08-31, 20:41)bsoriano Wrote: 2. How could you list the items that you have in your db first, and then the online ones? I tried putting sortby="DBID" in the <content>, but that did not work.
I don't know of any specific sort method for dbid.
An option to put dbid items first in the list is definitely on my todo list though!

(2019-08-31, 20:41)bsoriano Wrote: 3. Since my collection is large, I have quite a few movies for which there are two or more with the same name.  Would you consider extending the code with which you determine if a movie is in the local db by also using the year as well as the name? That way, at least in my use case, I would not get a lot of mis-identified movies (for example, I have 4 Robin Hood movies, and since the plugin call returns the first one (I think), a lot of times it is the incorrect one.)
I was checking against imdb_id first but I've just realised that the tmdb lists don't actually return imdb id - it's only in the detailed item which is a real pain.
Yes, I'll add some additional checks for year as I've also noticed these false positives. It is probably better to miss a match occasionally than have an incorrect match.

@jurialmunkey, thank you so much for looking into all of these Smile

Regards,

Bart


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

(2019-09-01, 03:06)bsoriano Wrote:
(2019-09-01, 00:48)jurialmunkey Wrote:
(2019-08-31, 18:21)bsoriano Wrote: 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:

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.

I've noticed this issue too - can get it by pulling up the power menu. It seems to be a Kodi bug because ListItem.Label shouldn't change whilst in DialogVideoInfo and it definitely shouldn't become the label of a modal dialog. The bug would cause issues for any plugin where ListItem.Label is passed to it.

In terms of the actual error raised by TMDbHelper - that can safely be ignored. I only raise the error to get the notification and traceback for debugging purposes. In the final version I won't raise the error and it will just be a single line in the log (without the traceback or error notification in Kodi) because it isn't actually a serious issue.

@jurialmunkey, thanks for the explanation. I will ignore the error then. My problem in the scenario, apart from the error, is that my custom search window for searching in the local db will not open (or closes immediately) in this case. I am not sure why this happens, I have not been able to find anything in the code. I thought there might be something with the onback functions and deleting the path, but I have not managed to find the cause.

Regards,

Bart

I assume you are using some sort of fake dialog to give the user an option of choosing whether to search using TMDb or local library, yes?
Can you point me to the lines where this fake dialog is in Amber - I think I have an idea of what is going wrong.


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

@bsoriano
I've added the exclusion filtering in latest version:
Code:
&amp;exclude_key=title&amp;exclude_value=$INFO[ListItem.Title]

I've also added better DBID checking which uses year as well as title.

EDIT: Added sorting by DBID. Items with a DBID will be put at the front with default sortby method.