Jump to content

Updated .nfo ratings format


Bambu Utila

Recommended Posts

Bambu Utila

Hi would it be possible to update the ratings part in the .nfo files so Kodi can scan ratings better?

At the moment Emby seems to store the rating like this

<rating>6.4</rating>

 

When Emby for Kodi adds info to Kodi it uses the nfo files to populate the database at the moment it enters default for rating_type, so skins have no idea which rating is actually stored in the ratings field. Could be IMDB, TMDB,...

Kodi suggests the following layout for ratings:

<rating name="imdb" max="10" default="true">
<value>6.200000</value>
<votes>4718</votes>
</rating>

This way multiple ratings can be stored for one movie/tv show in the nfo file and the Kodi DB gets populated properly as well.

 

Edit: When i wrote this feature request it was with my limited understanding that Kodi simply used the .nfo files that Emby makes for importing data.

Since then i've learned there is actually way more going on in the background, as explained below.

With that in mind i would like to change/upgrade my request:

Can Emby update it's internal way of storing ratings so that it can store IMDB/TMDB/Rotten Tomatoes/Metacritics?

Edited by Bambu Utila
Update of feature request
  • Like 1
Link to comment
Share on other sites

Bambu Utila

I've done some more testing in the last day and i've come to the conclusion that i don't really understand how the data from Emby gets to the Kodi DB

I assumed that the Emby for Kodi addon used the .nfo files and Kodi would just read those and populate it's DB. This doesn't seem to be the case.

After a movie was scraped by Emby and then added to the Kodi db i changed the .nfo file so it would contain the expected ratings format for Kodi.

I did an update for that library in Kodi and I repaired the library, both have the same result. out of the list of ratings it only selected the imdb one.

So it seems the Emby for Kodi addon does not just use the .nfo file as a source for adding media, there seem to be some conversions going on in the back rather than just handing over the .nfo files to Kodi.

 

So my request for adjusting the .nfo files alone will not solve the problem it would also require the Emby for Kodi addon to parse the file differently :(

Link to comment
Share on other sites

pünktchen

In short: the Emby for Kodi addon syncs the Emby SQLite database to Kodi SQLite database.

The Emby database only has two kinds of rating. Official rating and community rating. With nfo files Emby uses whatever is the default rating in the nfo as official rating. So this could be IMDB, TMDB, RottenTomatos or whatever.

Emby doesn't store the source of the rating, only the value. The Emby for Kodi addon asumes the official rating of Emby is always TMDB for movies, which would be true without nfo files, and syncs this to Kodi.

Link to comment
Share on other sites

Bambu Utila
54 minutes ago, pünktchen said:

In short: the Emby for Kodi addon syncs the Emby SQLite database to Kodi SQLite database.

The Emby database only has two kinds of rating. Official rating and community rating. With nfo files Emby uses whatever is the default rating in the nfo as official rating. So this could be IMDB, TMDB, RottenTomatos or whatever.

Emby doesn't store the source of the rating, only the value. The Emby for Kodi addon asumes the official rating of Emby is always TMDB for movies, which would be true without nfo files, and syncs this to Kodi.

Thanks for this explanation!

What would already be useful then is if the Emby for Kodi addon would mark down in the ratings table in the Kodi DB that the rating_type is TMDb rather than default.

Ideal would be if Emby would scan for all ratings and store them in their DB just like Kodi does, this would solve issues with ratings showing up consistently.

Edit: Come to think of it, you are not completely correct. the official rating in Emby depends on what scraper you use. I'm pretty sure i read somewhere here in a thread that @Luke said if you use the OMDB API it stores the imdb rating in the official rating.

So it would be great that at a minimum the Emby for Kodi addon would write down what rating it was storing in the Kodi DB either themovieDB or imdb

Edited by Bambu Utila
Link to comment
Share on other sites

pünktchen
1 hour ago, Bambu Utila said:

Edit: Come to think of it, you are not completely correct. the official rating in Emby depends on what scraper you use. I'm pretty sure i read somewhere here in a thread that @Luke said if you use the OMDB API it stores the imdb rating in the official rating.

That's maybe true, but the default movie scraper is TMDB 😉

So it would be great that at a minimum the Emby for Kodi addon would write down what rating it was storing in the Kodi DB either themovieDB or imdb

Probably the Kodi addon just was never adopted to the newer way of storing ratings in the Kodi database. And the addon currently lacks of developers. The Emby developers wont do this, because it's a community addon for Kodi, not for Emby. But hey, the addon is open source and written in Python. You can edit it with every text editor and change it to your liking.

Link to comment
Share on other sites

Bambu Utila
23 minutes ago, pünktchen said:

That's maybe true, but the default movie scraper is TMDB 😉

 

Probably the Kodi addon just was never adopted to the newer way of storing ratings in the Kodi database. And the addon currently lacks of developers. The Emby developers wont do this, because it's a community addon for Kodi, not for Emby. But hey, the addon is open source and written in Python. You can edit it with every text editor and change it to your liking.

I'm not a developer but i just had a look in some of those files and i think i already found how to change it.

Might give it a try later today and see how it goes. I'll just have to go through all files to make sure i don't forget any instances.

All it would do is write imdb or themovieDB in the rating_type in stead of default. But it think that alone would help out loads

Link to comment
Share on other sites

Bambu Utila
21 hours ago, pünktchen said:

Probably the Kodi addon just was never adopted to the newer way of storing ratings in the Kodi database. And the addon currently lacks of developers. The Emby developers wont do this, because it's a community addon for Kodi, not for Emby. But hey, the addon is open source and written in Python. You can edit it with every text editor and change it to your liking.

Thanks again for the encouragement!

I've looked into it last night and managed to adjust the plugin so it now writes down the name of the rating provider.

It's not a full solution because the name of the provider is hard coded. So you need to check what rating is stored in Emby first.

But it only took adjusting 6 lines in total spread out over 2 files. Now when i check my Kodi DB in the rating table all rating_type fields have a proper value now instead of default.

This will do until the Emby team or Kodi team can sort out a proper way of handling multiple ratings.

Link to comment
Share on other sites

We don't currently store the sources of ratings in our database. We probably should, but the question for now until we do that is, should we leave things as-is, or should we take a best guess of where the rating probably came from? Most likely tv ratings came from tvdb and movies from MovieDb, but I think it's probably best to keep things as they are.

The critic rating though we can write explicitly.

Link to comment
Share on other sites

Bambu Utila
11 minutes ago, Luke said:

We don't currently store the sources of ratings in our database. We probably should, but the question for now until we do that is, should we leave things as-is, or should we take a best guess of where the rating probably came from? Most likely tv ratings came from tvdb and movies from MovieDb, but I think it's probably best to keep things as they are.

The critic rating though we can write explicitly.

Until you store the different ratings in the Emby DB i guess it would be best to leave things as is.

What would be useful is to know what ratings you guys store in the ratings field depending on which scraper is set first and second.

My understanding so far is that if you use OMDB first and then TMDB you get IMDB rating and Rotten Tomato rating, unless OMDB doesn't return an IMDB rating then you get the TMBD rating.

For tv shows same thing if you use OMDB first and TVDB as second you get imdb rating for tv show ratings.

If you use TVDB then OMDB you will get tvdb ratings. At the moment this is not as useful anymore since you can't rate tv shows anymore on the TVDB so new shows all show 0.0 as a rating

Can you confirm or correct what i think about the ratings?

For now i have adjusted the Emby for Kodi addon so that it writes imdb and tomatometerallcritics into the ratings table instead of default 

Link to comment
Share on other sites

Quote

My understanding so far is that if you use OMDB first and then TMDB you get IMDB rating and Rotten Tomato rating, unless OMDB doesn't return an IMDB rating then you get the TMBD rating.

For tv shows same thing if you use OMDB first and TVDB as second you get imdb rating for tv show ratings.

Exactly it goes by your metadata fetcher priority.

Link to comment
Share on other sites

  • 3 months later...
Centory
On 6/20/2020 at 9:10 PM, Bambu Utila said:

For now i have adjusted the Emby for Kodi addon so that it writes imdb and tomatometerallcritics into the ratings table instead of default 

Hello, in what file exactly? I need/want the same thing, for now i use the "Light IMDb Ratings Update", but everytime when i have watched a movie, i lost the updated ratings and the votes.

Link to comment
Share on other sites

  • 3 years later...
Killface69

I currently have an issue with some lesser known series. TinyMediaManager is able to scrape severall sources for ratings. As in my example below, tmdb is fist in xml, but trakt is set to default as I like the more balanced ratings (and also the one person has no taste :-P). I'm not able to remove the ratings from TMM other than manually each episode ...
Would it be possible to look for the 'default=true' tag in the xml and use this rating for the community source?
 

  <ratings>
    <rating default="false" max="10" name="themoviedb">
      <value>4.0</value>
      <votes>1</votes>
    </rating>
    <rating default="false" max="10" name="imdb">
      <value>7.4</value>
      <votes>213</votes>
    </rating>
    <rating default="true" max="10" name="trakt">
      <value>7.6</value>
      <votes>126</votes>
    </rating>
  </ratings>

 

Link to comment
Share on other sites

Killface69
16 minutes ago, Killface69 said:

I currently have an issue with some lesser known series. TinyMediaManager is able to scrape severall sources for ratings. As in my example below, tmdb is fist in xml, but trakt is set to default as I like the more balanced ratings (and also the one person has no taste :-P). I'm not able to remove the ratings from TMM other than manually each episode ...
Would it be possible to look for the 'default=true' tag in the xml and use this rating for the community source?
 

  <ratings>
    <rating default="false" max="10" name="themoviedb">
      <value>4.0</value>
      <votes>1</votes>
    </rating>
    <rating default="false" max="10" name="imdb">
      <value>7.4</value>
      <votes>213</votes>
    </rating>
    <rating default="true" max="10" name="trakt">
      <value>7.6</value>
      <votes>126</votes>
    </rating>
  </ratings>

 

Too late to edit, it already works that way. Thanks!

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...