•   
  • 1
  • 2
  • 3
  • 4(current)
  • 5
  • 6
  • 8
  •   
Alpha plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners
#46
(2019-08-04, 10:53)jurialmunkey Wrote: ListItem.Property(property):
tmdb_id
Genre.X.Name, Genre.X.ID, Studio.X.Name, Studio.X.ID, Country.X.Name, Country.X.ID
birthday, deathday, aliases, role, born
budget, revenue
awards
metacritic_rating
imdb_rating, imdb_votes
rottentomatoes_rating, rottentomatoes_image, rottentomatoes_consensus
rottentomatoes_reviewtotal, rottentomatoes_reviewsfresh, rottentomatoes_reviewsrotten
rottentomatoes_usermeter, rottentomatoes_userreviews
Ok as far i unterstand all that there the ratings+votes for imdbtomatometerallcriticstomatometerallaudience

For metacritic only ratings (without votes)

And no ratings+votes for themoviedb and tvdb


sry i still use the kodi internal ratings/votes InfoLabels for my personal overview.
Reply
#47
@jurialmunkey , I am in the process of adding some of the plugin paths from this addon as widgets in Amber.  One issue I noticed is that for movies, I can press i on any widget item, and I will get an info dialog with some of the info (I understand this is correct, I will have to create a custom info dialog for movies/tv shows to use with these widgets), but for tv shows, if I press i nothing happens.  Is this an issue on your end that can be fixed? 

Thanks again for your awesome work on this plugin.

Regards,

Bart
Reply
#48
(2019-08-04, 10:31)jurialmunkey Wrote:
(2019-08-03, 18:03)Mr. V Wrote:
(2019-08-03, 07:29)jurialmunkey Wrote: If you get that pop-up it means you are getting a 401 error from the API which means that the API KEY you've inputted is unauthorised to access the resource.
Are you sure you are entering a valid API KEY into the settings dialog? The API KEY is a different thing from a TMDb ID.
Info about how to get an API KEY is here:
https://developers.themoviedb.org/3/gett...troduction   


I am 100% sure the api key is correct.

The script is working when opening any of the movie nodes and showing me a list and artwork, it only shows the error when i click on a movie. TV shows work fine.

Debug log if it helps.
https://pastebin.com/ZvzqPaTK 

Hmm I'm not sure. I need to write in some error checking to get a better picture.
Also, I've just done a fairly big re-write of the code, so can you check with latest and see if this issue is still occurring? 

I checked the logs again and followed the web link to the api call.
TMDB was ok, OMDB was not.

I needed to re-activate my old omdb key in the verification email for some reason. I was thrown off a bit due to the kodi pop-up message of tmdb key being invalid.

Problem solved. Thanks.
Reply
#49
(2019-08-04, 22:45)Mr. V Wrote:
(2019-08-04, 10:31)jurialmunkey Wrote:
(2019-08-03, 18:03)Mr. V Wrote: I am 100% sure the api key is correct.

The script is working when opening any of the movie nodes and showing me a list and artwork, it only shows the error when i click on a movie. TV shows work fine.

Debug log if it helps.
https://pastebin.com/ZvzqPaTK 

Hmm I'm not sure. I need to write in some error checking to get a better picture.
Also, I've just done a fairly big re-write of the code, so can you check with latest and see if this issue is still occurring? 

I checked the logs again and followed the web link to the api call.
TMDB was ok, OMDB was not.

I needed to re-activate my old omdb key in the verification email for some reason. I was thrown off a bit due to the kodi pop-up message of tmdb key being invalid.

Problem solved. Thanks.
Ah of course! I use a single function to make the request and do error checking on the response. I didn't even consider omdb api key being wrong for some reason.

I will have to add a check to see if the request is to tmdb or omdb and change the wording on the dialog.

Thanks for the follow up!
Reply
#50
(2019-08-04, 19:28)bsoriano Wrote: @jurialmunkey , I am in the process of adding some of the plugin paths from this addon as widgets in Amber.  One issue I noticed is that for movies, I can press i on any widget item, and I will get an info dialog with some of the info (I understand this is correct, I will have to create a custom info dialog for movies/tv shows to use with these widgets), but for tv shows, if I press i nothing happens.  Is this an issue on your end that can be fixed? 

Thanks again for your awesome work on this plugin.

Regards,

Bart

Should be fixed now. Can you test and confirm?

Also, in terms of info, you shouldn't need to add a new info dialog. You can just add a hidden list with the ?info=details plugin path to the info dialog, then you can use things like $INFO[Container(ID).ListItemAbsolute(0).Genre] in a variable to get the additional info.

There are a couple of ways to get the detailed info list:
By TMDb ID (though you are unlikely to have this for items in the library)
plugin://plugin.video.themoviedb.helper/?info=details&type=movie&tmdb_id=$INFO[ListItem.Property(tmdb_id)]
By IMDb Number:
plugin://plugin.video.themoviedb.helper/?info=find&type=movie&imdb_id=$INFO[ListItem.IMDBNumber]
By Title:
plugin://plugin.video.themoviedb.helper/?info=details&type=movie&query=$INFO[ListItem.Title]

Best match will be TMDb ID, next best is IMDb Number.
If you don't have either, then query by title and can add &year=$INFO[ListItem.Year]
Use a variable in the content path of the hidden list so that you can check for each of these and use the best one if available.

You could also potentially do this in the library to act as a skinhelper replacement - but I'm not sure this is advisable as quick scrolling in the library will make a lot of requests. I'm currently looking at ways to check the user state (if scrolling etc) and add some sort of minimal rate limiter - as it will then be possible to replace skinhelper with the details plugin path.
Reply
#51
(2019-08-05, 00:33)jurialmunkey Wrote:
(2019-08-04, 19:28)bsoriano Wrote: @jurialmunkey , I am in the process of adding some of the plugin paths from this addon as widgets in Amber.  One issue I noticed is that for movies, I can press i on any widget item, and I will get an info dialog with some of the info (I understand this is correct, I will have to create a custom info dialog for movies/tv shows to use with these widgets), but for tv shows, if I press i nothing happens.  Is this an issue on your end that can be fixed? 

Thanks again for your awesome work on this plugin.

Regards,

Bart

Should be fixed now. Can you test and confirm?

Also, in terms of info, you shouldn't need to add a new info dialog. You can just add a hidden list with the ?info=details plugin path to the info dialog, then you can use things like $INFO[Container(ID).ListItemAbsolute(0).Genre] in a variable to get the additional info.

There are a couple of ways to get the detailed info list:
By TMDb ID (though you are unlikely to have this for items in the library)
plugin://plugin.video.themoviedb.helper/?info=details&type=movie&tmdb_id=$INFO[ListItem.Property(tmdb_id)]
By IMDb Number:
plugin://plugin.video.themoviedb.helper/?info=find&type=movie&imdb_id=$INFO[ListItem.IMDBNumber]
By Title:
plugin://plugin.video.themoviedb.helper/?info=details&type=movie&query=$INFO[ListItem.Title]

Best match will be TMDb ID, next best is IMDb Number.
If you don't have either, then query by title and can add &year=$INFO[ListItem.Year]
Use a variable in the content path of the hidden list so that you can check for each of these and use the best one if available.

You could also potentially do this in the library to act as a skinhelper replacement - but I'm not sure this is advisable as quick scrolling in the library will make a lot of requests. I'm currently looking at ways to check the user state (if scrolling etc) and add some sort of minimal rate limiter - as it will then be possible to replace skinhelper with the details plugin path.
@jurialmunkey, thanks! As soon as I get home I will try it out. So for movies not in my library, I would also have another hidden list for the cast, so I can show it in the info dialog?

Regards,

Bart
Reply
#52
(2019-08-05, 00:56)bsoriano Wrote:
(2019-08-05, 00:33)jurialmunkey Wrote:
(2019-08-04, 19:28)bsoriano Wrote: @jurialmunkey , I am in the process of adding some of the plugin paths from this addon as widgets in Amber.  One issue I noticed is that for movies, I can press i on any widget item, and I will get an info dialog with some of the info (I understand this is correct, I will have to create a custom info dialog for movies/tv shows to use with these widgets), but for tv shows, if I press i nothing happens.  Is this an issue on your end that can be fixed? 

Thanks again for your awesome work on this plugin.

Regards,

Bart

Should be fixed now. Can you test and confirm?

Also, in terms of info, you shouldn't need to add a new info dialog. You can just add a hidden list with the ?info=details plugin path to the info dialog, then you can use things like $INFO[Container(ID).ListItemAbsolute(0).Genre] in a variable to get the additional info.

There are a couple of ways to get the detailed info list:
By TMDb ID (though you are unlikely to have this for items in the library)
plugin://plugin.video.themoviedb.helper/?info=details&type=movie&tmdb_id=$INFO[ListItem.Property(tmdb_id)]
By IMDb Number:
plugin://plugin.video.themoviedb.helper/?info=find&type=movie&imdb_id=$INFO[ListItem.IMDBNumber]
By Title:
plugin://plugin.video.themoviedb.helper/?info=details&type=movie&query=$INFO[ListItem.Title]

Best match will be TMDb ID, next best is IMDb Number.
If you don't have either, then query by title and can add &year=$INFO[ListItem.Year]
Use a variable in the content path of the hidden list so that you can check for each of these and use the best one if available.

You could also potentially do this in the library to act as a skinhelper replacement - but I'm not sure this is advisable as quick scrolling in the library will make a lot of requests. I'm currently looking at ways to check the user state (if scrolling etc) and add some sort of minimal rate limiter - as it will then be possible to replace skinhelper with the details plugin path.
@jurialmunkey, thanks! As soon as I get home I will try it out. So for movies not in my library, I would also have another hidden list for the cast, so I can show it in the info dialog?

Regards,

Bart
Do you want cast as a list or as a label?

I can add it as a label.

For a list there isn't anyway to override the default id=50 list in the info dialog, so you would need a separate list.
Reply
#53
Awesome work. This looks like it can replace skin helper which isn't being updated.

Be good if could cache the data so doesn't fetch data everytime. Maybe have an option to set how long to keep cache before it refetches.

Cheers
Reply
#54
(2019-08-05, 02:14)the_bo Wrote: Awesome work. This looks like it can replace skin helper which isn't being updated.

Be good if could cache the data so doesn't fetch data everytime. Maybe have an option to set how long to keep cache before it refetches.

Cheers
Yeah caching definitely on the cards. Just want to get default functionality all working first and run it through some heavy testing, then I'll look at extending functionality.

EDIT: Added Caching.
That was easier than expected using simplecache.
Reply
#55
Hi @jurialmunkey Started playing around with this and I am getting an error in the log for the latest on GitHub whenever the plugin runs.

Code:
ERROR: EXCEPTION Thrown (PythonToCppException) :
-->Python callback/script returned the following error<--
NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.TypeError'>
Error Contents: unsupported operand type(s) for -: 'NoneType' and 'float'
Traceback (most recent call last):
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\plugin.video.themoviedb.helper\main.py", line 452, in <module>
    run_plugin()
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\plugin.video.themoviedb.helper\lib\apis.py", line 21, in decorated
    time_diff = cached_time - current_time
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
-->End of Python script error report<--

If I revert THIS COMMIT then there is no error.

Thanks.
Reply
#56
(2019-08-05, 19:31)mikeSiLVO Wrote: Hi @jurialmunkey Started playing around with this and I am getting an error in the log for the latest on GitHub whenever the plugin runs.

Code:
ERROR: EXCEPTION Thrown (PythonToCppException) :
-->Python callback/script returned the following error<--
NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.TypeError'>
Error Contents: unsupported operand type(s) for -: 'NoneType' and 'float'
Traceback (most recent call last):
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\plugin.video.themoviedb.helper\main.py", line 452, in <module>
    run_plugin()
File "C:\Program Files\Kodi (Matrix)\portable_data\addons\plugin.video.themoviedb.helper\lib\apis.py", line 21, in decorated
    time_diff = cached_time - current_time
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
-->End of Python script error report<--

If I revert THIS COMMIT then there is no error.

Thanks.

Whoops! Didn't account for having no cached last used time.
Should be fixed now. Can you test and confirm?
Reply
#57
(2019-08-06, 00:18)jurialmunkey Wrote: Whoops! Didn't account for having no cached last used time.
Should be fixed now. Can you test and confirm?

Confirmed, is working! Smile
Reply
#58
(2019-08-05, 04:20)jurialmunkey Wrote:
(2019-08-05, 02:14)the_bo Wrote: Awesome work. This looks like it can replace skin helper which isn't being updated.

Be good if could cache the data so doesn't fetch data everytime. Maybe have an option to set how long to keep cache before it refetches.

Cheers
Yeah caching definitely on the cards. Just want to get default functionality all working first and run it through some heavy testing, then I'll look at extending functionality.

EDIT: Added Caching.
That was easier than expected using simplecache.   

Thanks.

Will the simple cache interfere with skin helper cache as it uses simplecache also?

Will try disabling skin helper as this plugin replaces most of it.
Reply
#59
(2019-08-06, 18:31)the_bo Wrote:
(2019-08-05, 04:20)jurialmunkey Wrote:
(2019-08-05, 02:14)the_bo Wrote: Awesome work. This looks like it can replace skin helper which isn't being updated.

Be good if could cache the data so doesn't fetch data everytime. Maybe have an option to set how long to keep cache before it refetches.

Cheers
Yeah caching definitely on the cards. Just want to get default functionality all working first and run it through some heavy testing, then I'll look at extending functionality.

EDIT: Added Caching.
That was easier than expected using simplecache.   

Thanks.

Will the simple cache interfere with skin helper cache as it uses simplecache also?

Will try disabling skin helper as this plugin replaces most of it.

No because I don't use metadatautils which is what is really cached by skinhelper.

Simplecache is just a SQL database that stores python lists/objects.
What this decorator that I wrote does is when a request is made to the api, it will check simplecache for a key name with the plugin name + request type + request query.

For example say I search for the movie "Alien", the key will be called:
"plugin.video.themoviedb.helper/tmdb_api/search/movie&query=Alien"

If that key is found in simplecache, then it's data will be returned instead of making an actual request to the API. If the key is NOT found, then I make the request and store it in the appropriately named simplecache key before returning it to the original method making the call.

I only rate limit requests to the actual APIs, not the cache. So if data is cached, it should return fairly quickly.
The rate limiting is currently set to 2 seconds between http requests if your own key is set and 4 seconds if my default key is being used (I'm currently trialing providing a default TMDb api key so I can see what the request levels are).
Reply
#60
(2019-08-07, 02:18)the_bo Wrote:
(2019-08-07, 01:57)jurialmunkey Wrote: @the_bo
See my response here: 2875160 (post)
Short answer is yes. Any request made to an API with my plugin is cached to simplecache (details cached for 14 days, lists cached for 24 hours).
If the cache for that request exists, then my plugin will use the cached version instead of making an api call.

Awesome thanks for info. Could you possibly add a setting to enter the number of days to cache. As I have lot of movies would prefer having ratings and such stored for few months.

Is batch fetching possible to automatically fetch and update cache ratings for all movies in library or have you to scroll through the list manually to fetch during each focused item at a time.

It's not a problem as I can have an autoscroll delay In the library that scrolls through all the movies during the night and fetches the details.

Looking forward to developments on this. Cheers

See latest version. Added options in addon settings for cache days
For details can choose 14, 21, 30, 60 days
For lists can choose 1 to 7, 14, 21, 30 days

Yeah no pre-fetching as opens things up to abuse. Lots of those crappy wizards and pre-built android boxes delete cache on startup - coupled with pre-fetching options will result in a massive number of requests.

The main reason for a slow down when using as a hidden list in the library is that scrolling creates a backlog of requests.
I'm looking into a way to only load the plugin if the user is not scrolling so that you don't end up with this backlog. The actual requests are relatively quick to do, it's just that I have to rate limit them to avoid overloading the servers so it takes a while for the plugin to work through the backlog. If I can make it so that the request is only made when the user is stopped on an item, then there wont be a backlog and the actual look-up will be fairly quick (basically same speed as when you browse the plugin in video-addons).
Reply
  •   
  • 1
  • 2
  • 3
  • 4(current)
  • 5
  • 6
  • 8
  •   
 
Thread Rating:
  • 1 Vote(s) - 5 Average



Logout Mark Read Team Forum Stats Members Help
plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners51