Kodi Community Forum

Full Version: Light IMDb Ratings Update 5.1.3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2017-08-21, 09:52)Maaarv Wrote: [ -> ]Hi axlt,

I'm not sure if my problem really is related with your addon but I'm facing the following issue since I installed it.

I'm using Emby with local nfo files.
When the Emby for Kodi addon syncs newly added media to Kodi it messes up the rating somehow.
Unfortunately, this did not happen before using your addon.

For example I added some movie with an imdb rating of 8.2 which is shown correctly in Emby itself.
For some reason in Kodi the movie comes up with 6.7.

When resetting the Kodi database via the Emby for Kodi addon settings the movie correctly shows 8.2.
and when running your addon the movie gets properly updated to 8.2 aswell. So this works.

But I want my movies to have the rating specified in my nfo files right after adding them of course.

I already tried uninstalling your addon but I still got the same issue.
And as it doesn't seem to be Emby related (already checked the Emby forum) it maybe has to do with the php installation alongside your addon.
Do I need to uninstall any other files/folders after uninstalling your addon so that I can narrow down the issue a bit.

I'd really like to use your addon together with Emby.

Hi Maaarv,

The add-on just updates the ratings on scheduled or manual basis. I would see the issue you described more related to the Emby for Kodi add-on and/or in the Kodi library update...I can not really understand the magic behind having the rating equal to 6.7 if the movie is not present in Kodi and imported with 8.2...Confused

And if you say "I already tried uninstalling your addon but I still got the same issue." makes me feel more comfortable... Wink
Hi folks,

Just to notify the release of a new version; we are now at 2.1.1.

This release just fixes a sporadic issue related to the standalone TV Shows update (thanks again to cgi2011 for testing).

As usual, you will find the updated link in the first post.

Have a nice evening!
(2017-08-21, 15:28)axlt2002 Wrote: [ -> ]
(2017-08-20, 23:54)Jelf10 Wrote: [ -> ]hoping OSMC was included in latest release as i seen you did a test build.
But no, still waiting- patiently Big Grin

Hi Jelf10,

You are perfectly right, but I'm still waiting for the reponse from the guy to which I provided the test build. May be you can help me? Since I have to reimplement the modification, can you please provide a debug log while running the PHP installation? Please use the latest version of the add-on (2.1.0).

Thanks in advance for your help.

Hi,
Been away so haven't had chance to look at this, not quite sure if I've done it right.
By running PHP installation is that a separate addon or just installing your addon to make that happen?
I've added debug log while installing your addon if that helps if not let me know.
Pastebin
@Jelf10

Can you check your pastebin link. It seems to be wanting to download a file, rather than the usual opening up a new tab and displaying the data.
People should paste the 'raw' version of their texts, preferrably. Smile
(2017-09-02, 23:27)Karellen Wrote: [ -> ]@Jelf10

Can you check your pastebin link. It seems to be wanting to download a file, rather than the usual opening up a new tab and displaying the data.

ooops sorry pastebin
Hi axlt, thx for your addon, great work.

I have suggestion for TV Shows rating update, when there is TVDB_ID only (or type "unknown" correctly). I wrote little perl script for put in database missing IMDB_ID, but you can implement this method in addon easily. I use TheMovieDB API for changing TVDB_ID to IMDB_ID:
1. find - for take TheMovieDB_ID from TVDB_ID
https://developers.themoviedb.org/3/find
2. get - for obtaining IMDB_ID
https://developers.themoviedb.org/3/tv/g...ternal-ids
Then you can use IMDB_ID for query, or better, update local DB also (for next queries).

Info how to get API KEY (needed for both methods) is here: https://developers.themoviedb.org/3/getting-started
(2017-09-02, 23:43)Jelf10 Wrote: [ -> ]
(2017-09-02, 23:27)Karellen Wrote: [ -> ]@Jelf10

Can you check your pastebin link. It seems to be wanting to download a file, rather than the usual opening up a new tab and displaying the data.

ooops sorry pastebin

Hi Jelf10,

Thanks for providing the log.

Unfortunately it does not contain the needed information. After having started Kodi and with the debug enabled, you should go into the add-on settings and run a manual PHP installation...at this point in time I'm expecting you will receive the message that your platform is not supported...but the log should contain the information needed to make the appropriate changes to the code.

I'm looking forward for a new log! Wink

Ciao!
(2017-09-04, 10:25)dziobak Wrote: [ -> ]Hi axlt, thx for your addon, great work.

I have suggestion for TV Shows rating update, when there is TVDB_ID only (or type "unknown" correctly). I wrote little perl script for put in database missing IMDB_ID, but you can implement this method in addon easily. I use TheMovieDB API for changing TVDB_ID to IMDB_ID:
1. find - for take TheMovieDB_ID from TVDB_ID
https://developers.themoviedb.org/3/find
2. get - for obtaining IMDB_ID
https://developers.themoviedb.org/3/tv/g...ternal-ids
Then you can use IMDB_ID for query, or better, update local DB also (for next queries).

Info how to get API KEY (needed for both methods) is here: https://developers.themoviedb.org/3/getting-started

Thanks a lot dziobak for your suggestion.

I definitely will take a look to it. I see even a more extended use of this approach than just manage the "unknown IMDB ID" issue. In fact, being the TVDB ID the default TV Show/Episode ID supported by Kodi, this approah would enable a standalone solution without using an external media manager to obtain any IMDB ID! Sounds promising... Nod

So far I see the following two points (the first one is the most...serious):
  • Starting from the TVDB ID, there will be one query to obtain the TheMovieDB_ID, another one to obtain the IMDB ID and a third one to query the IMDb site for updating the rates...it is also true that this will happen just at the first update (i.e. the IMDB ID should be saved for the next runs)
  • All the users will have to create their own API key...I don't want to provide support for that too! Tongue

I will keep you updated. Hope to have free time soon to give it a try!

Grazie!
(2017-09-04, 23:09)axlt2002 Wrote: [ -> ]So far I see the following two points (the first one is the most...serious):
  • Starting from the TVDB ID, there will be one query to obtain the TheMovieDB_ID, another one to obtain the IMDB ID and a third one to query the IMDb site for updating the rates...it is also true that this will happen just at the first update (i.e. the IMDB ID should be saved for the next runs)

or you can cache this pairs TVDB ID->IMDB ID in local table -> write to file after, read from file before.

(2017-09-04, 23:09)axlt2002 Wrote: [ -> ]
  • All the users will have to create their own API key...I don't want to provide support for that too! Tongue

  • You will make one API key only for application and this way is ok (for testing my little prog I used key from other app also)
    (2017-09-05, 00:19)dziobak Wrote: [ -> ]
    (2017-09-04, 23:09)axlt2002 Wrote: [ -> ]So far I see the following two points (the first one is the most...serious):
    • Starting from the TVDB ID, there will be one query to obtain the TheMovieDB_ID, another one to obtain the IMDB ID and a third one to query the IMDb site for updating the rates...it is also true that this will happen just at the first update (i.e. the IMDB ID should be saved for the next runs)

    or you can cache this pairs TVDB ID->IMDB ID in local table -> write to file after, read from file before.

    (2017-09-04, 23:09)axlt2002 Wrote: [ -> ]
  • All the users will have to create their own API key...I don't want to provide support for that too! Tongue

  • You will make one API key only for application and this way is ok (for testing my little prog I used key from other app also)

    I guess it would be preferrable to save the IMDB ID in the TV Show/Episode information of the Kodi library in the uniqueid field.

    About the single API key...how it will be managed if used by differnet users? Let's say 100 users with a library of 100 Episodes (I guess it will be quite more...)...this is already bringing to 10000 requests to the site...do you know if there is a limit to the number if queries?
    (2017-09-05, 00:32)axlt2002 Wrote: [ -> ]About the single API key...how it will be managed if used by differnet users? Let's say 100 users with a library of 100 Episodes (I guess it will be quite more...)...this is already bringing to 10000 requests to the site...do you know if there is a limit to the number if queries?

    There is limit of requests per time (40 req for few sec? or 40 req per 1 sec for one key?), if over, then response gives status code 25.
    I used sleep in my perl code:

    PHP Code:
    my $repeat 1;
    while (
    $repeat) {
            print 
    " -> asking TMDB for tvshow $ref->{'value'}\n";
            
    my $url "https://api.themoviedb.org/3/find/".$ref->{'value'}.
              
    "?api_key=".$api_key."&language=en-US&external_source=tvdb_id";
            
    $response $http->get($url);
            print 
    LOG "$url\n$response->{content}\n" if ($do_log);
            if (
    $response->{content} =~ /"status_code":25,/) { print " -> sleep\n"sleep 1; }
            else { 
    $repeat 0; }
          } 
    (2017-09-05, 07:51)dziobak Wrote: [ -> ]
    (2017-09-05, 00:32)axlt2002 Wrote: [ -> ]About the single API key...how it will be managed if used by differnet users? Let's say 100 users with a library of 100 Episodes (I guess it will be quite more...)...this is already bringing to 10000 requests to the site...do you know if there is a limit to the number if queries?

    There is limit of requests per time (40 req for few sec? or 40 req per 1 sec for one key?), if over, then response gives status code 25.
    I used sleep in my perl code:

    PHP Code:
    my $repeat 1;
    while (
    $repeat) {
            print 
    " -> asking TMDB for tvshow $ref->{'value'}\n";
            
    my $url "https://api.themoviedb.org/3/find/".$ref->{'value'}.
              
    "?api_key=".$api_key."&language=en-US&external_source=tvdb_id";
            
    $response $http->get($url);
            print 
    LOG "$url\n$response->{content}\n" if ($do_log);
            if (
    $response->{content} =~ /"status_code":25,/) { print " -> sleep\n"sleep 1; }
            else { 
    $repeat 0; }
          } 

    Thanks for the hint! From my point of view it sounds reasonable when just one user is making a query to the site. Don't know if it can fit for multiple users...

    I think that the only way to be sure about this point will be to try! I will try to implement something in the next days...eventually be prepared for some PMs asking for suggestions... Wink

    Have a great day!
    Axlt,
    if this will help, there is my perl https://pastebin.com/QGEbXiqk
    I use two profiles, with separate mysql databases, this perl script works directly on SQL.
    There are two parts - first for tvshows, second for episodes.
    For episodes is other method: find with tvdb id of episode, then external_ids with tmdb_id of tvshow (not tmdb episode id), season and episode number.
    This is place for optimization - if we have tmdb_id from tvshow checking (saved in uniqueid field next to IMDB ID) then we can call for external_ids directly.
    (2017-09-05, 00:32)axlt2002 Wrote: [ -> ]
    (2017-09-05, 00:19)dziobak Wrote: [ -> ]
    (2017-09-04, 23:09)axlt2002 Wrote: [ -> ]So far I see the following two points (the first one is the most...serious):
    • Starting from the TVDB ID, there will be one query to obtain the TheMovieDB_ID, another one to obtain the IMDB ID and a third one to query the IMDb site for updating the rates...it is also true that this will happen just at the first update (i.e. the IMDB ID should be saved for the next runs)

    or you can cache this pairs TVDB ID->IMDB ID in local table -> write to file after, read from file before.

    (2017-09-04, 23:09)axlt2002 Wrote: [ -> ]
  • All the users will have to create their own API key...I don't want to provide support for that too! Tongue

  • You will make one API key only for application and this way is ok (for testing my little prog I used key from other app also)

    I guess it would be preferrable to save the IMDB ID in the TV Show/Episode information of the Kodi library in the uniqueid field.

    About the single API key...how it will be managed if used by differnet users? Let's say 100 users with a library of 100 Episodes (I guess it will be quite more...)...this is already bringing to 10000 requests to the site...do you know if there is a limit to the number if queries?

    Easier said then done, but you can add a field where the user can populate their personal API Key