Kodi reads NFO file for rating, and it imports the "criticrating" as the "userRating"
#1
Question 
Hey all, 

The issue i have is that when Kodi Imports my Movie files, it reads the NFO files and it loads the <criticrating> field from the NFO files as the "userRating" / "My Rating". 
(This issue doesnt occur for my TV Show files in KODI, even though they use the same NFO info providers)

I have checked the way Kodi is expecting these NFO files to be structured (https://kodi.wiki/view/NFO_files/Movies#nfo_Tags)

Which is like this:
 <ratings>
   <rating name="" max="10" default="">
      <value></value>
      <votes></votes>
   </rating>
<rating name="themoviedb" max="10" default="true">
<rating name="imdb" max="10" default="false">
 </ratings>

My current NFO files do indeed not have this structure, because they are created by Jellyfin using the "The Open Movie Database" or "TheMovieDB"

But the weird thing is that KODI doesnt load the <rating> field as "My Rating" or "userRating" instead it loads the <criticrating> as such. 
While on the surface this doesnt look like a big issue, after using Kodi Trakt Sync
I suddenly had 10 pages of new "movie ratings" on trakt which were all "10" (because trakt goes from 0-10, and <criticrating> goes from 0-100)

I have been looking for a way to modify Jellyfin to just straight up omit ratings or criticratings all together, but cant seem to find a way to edit the way Jellyfin creates the NFO files (tried switching between "The Open Movie Database" or "TheMovieDB")

Does anybody know a way to either:

- Stop kodi from loading ratings from NFO files (but use the other NFO info)
- Stop Kodi from reading NFO files AT ALL (Jellyfin should inject the needed movie info by itself anyways i think)
- Stop kodi from loading <criticrating> from nfo file into the  "My Rating" / "userRating"
- Modify the way Jellyfin creates NFO files to omit the <rating> and <criticrating> fields
- Modify the way Jellyfin creates NFO files, to create proper <ratings> structure


Additional notes about my setup:
- Sonarr / Radarr
- Folder structure where IMDB ID is included in the movie folder name aka "Infinite (2021) [tt6654210]"
- Jellyfin to create NFO's and inject correct file paths into Kodi (Network drive paths etc)
- Latest version of Kodi using the Jellyfin Addon with the "Native" method so Jellyfin movies are added as "normal" movies into the Kodi database.
- Trakt to sync watch history and now with ratings syncing disabled because my Kodi library is a mess now Sad

Example of one of my NFO files:

xml:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<movie>
  <plot>A man discovers that his hallucinations are actually visions from past lives.</plot>
  <outline>Many lives. Unlimited potential.</outline>
  <lockdata>false</lockdata>
  <dateadded>2021-09-15 13:44:40</dateadded>
  <title>Infinite</title>
  <originaltitle>Infinite</originaltitle>
  <director>Antoine Fuqua</director>
  <writer>Ian Shorr</writer>
  <writer>Todd Stein</writer>
  <writer>D. Eric Maikranz</writer>
  <credits>Ian Shorr</credits>
  <credits>Todd Stein</credits>
  <credits>D. Eric Maikranz</credits>
  <trailer>plugin://plugin.video.youtube/?action=play_video&videoid=rubfbwFmKic</trailer>
  <trailer>plugin://plugin.video.youtube/?action=play_video&videoid=rubfbwFmKic</trailer>
  <trailer>plugin://plugin.video.youtube/?action=play_video&videoid=rubfbwFmKic</trailer>
  <trailer>plugin://plugin.video.youtube/?action=play_video&videoid=rubfbwFmKic</trailer>
  <trailer>plugin://plugin.video.youtube/?action=play_video&videoid=rubfbwFmKic</trailer>
  <trailer>plugin://plugin.video.youtube/?action=play_video&videoid=rubfbwFmKic</trailer>
  <trailer>plugin://plugin.video.youtube/?action=play_video&videoid=rubfbwFmKic</trailer>
  <trailer>plugin://plugin.video.youtube/?action=play_video&videoid=rubfbwFmKic</trailer>
  <trailer>plugin://plugin.video.youtube/?action=play_video&videoid=rubfbwFmKic</trailer>
  <trailer>plugin://plugin.video.youtube/?action=play_video&videoid=rubfbwFmKic</trailer>
  <rating>5.4</rating>
  <year>2021</year>
  <mpaa>PG-13</mpaa>
  <imdbid>tt6654210</imdbid>
  <tmdbid>581726</tmdbid>
  <premiered>2021-06-10</premiered>
  <releasedate>2021-06-10</releasedate>
  <criticrating>16</criticrating>
  <runtime>106</runtime>
  <tagline>Many lives. Unlimited potential.</tagline>
  <country>United States of America</country>
  <genre>Action</genre>
  <genre>Sci-Fi</genre>
  <genre>Thriller</genre>
  <studio>Di Bonaventura Pictures</studio>
  <studio>Closest to the Hole Productions</studio>
  <studio>Leverage Entertainment</studio>
  <tag>based on novel or book</tag>
  <tag>reincarnation</tag>
  <art>
    <poster>C:\ProgramData\Jellyfin\Server\metadata\library\af\aff4e25714c5f0c92fe3c0a3a70be69d\poster.jpg</poster>
    <fanart>C:\ProgramData\Jellyfin\Server\metadata\library\af\aff4e25714c5f0c92fe3c0a3a70be69d\backdrop.jpg</fanart>
  </art>
  <actor>
    <name>Mark Wahlberg</name>
    <role>Evan McCauley</role>
    <type>Actor</type>
    <sortorder>0</sortorder>
    <thumb>C:\ProgramData\Jellyfin\Server\metadata\People\M\Mark Wahlberg\folder.jpg</thumb>
  </actor>
  <actor>
    <name>Valerii An</name>
    <role>Executive Producer</role>
    <type>Producer</type>
  </actor>
  <id>tt6654210</id>
  <fileinfo>
    <streamdetails>
      <video>
        <codec>h264</codec>
        <micodec>h264</micodec>
        <bitrate>2249020</bitrate>
        <width>1920</width>
        <height>800</height>
        <aspect>2.40:1</aspect>
        <aspectratio>2.40:1</aspectratio>
        <framerate>24</framerate>
        <language>und</language>
        <scantype>progressive</scantype>
        <default>True</default>
        <forced>False</forced>
        <duration>106</duration>
        <durationinseconds>6380</durationinseconds>
      </video>
      <audio>
        <codec>aac</codec>
        <micodec>aac</micodec>
        <bitrate>384003</bitrate>
        <language>und</language>
        <scantype>progressive</scantype>
        <channels>6</channels>
        <samplingrate>48000</samplingrate>
        <default>True</default>
        <forced>False</forced>
      </audio>
      <subtitle>
        <codec>srt</codec>
        <micodec>srt</micodec>
        <scantype>progressive</scantype>
        <default>False</default>
        <forced>False</forced>
      </subtitle>
    </streamdetails>
  </fileinfo>
</movie>
Reply
#2
Not sure if this will help you but afaik, exporting nfo files via Kodi/Settings/Media/Library/Export Library/ (not the Jellyfin you are using) does not use <criticrating> but does show:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<movie>
    <title>Avatar</title>
    <originaltitle>Avatar</originaltitle>
    <ratings>
        <rating name="imdb" max="10" default="true">
            <value>7.800000</value>
            <votes>1081486</votes>
        </rating>
        <rating name="metacritic" max="10">
            <value>8.300000</value>
            <votes>35</votes>
        </rating>
        <rating name="themoviedb" max="10">
            <value>7.400000</value>
            <votes>20533</votes>
        </rating>
    </ratings>
    <userrating>0</userrating>

@Karellen may be able to further assist you.
HOW TO - Kodi 2D - 3D - UHD (4k) HDR Guide Internal & External Players iso menus
DIY HOME THEATER WIND EFFECT

W11 Pro 24H2 MPC-BE\HC madVR KODI 22 GTX960-4GB/RGB 4:4:4/Desktop 60Hz 8bit Video Matched Refresh rates 23,24,50,60Hz 8/10/12bit/Samsung 82" Q90R Denon S720W
Reply
#3
(2021-09-20, 17:01)frostycoin Wrote: - Stop kodi from loading ratings from NFO files (but use the other NFO info)
Not possible

(2021-09-20, 17:01)frostycoin Wrote: - Stop Kodi from reading NFO files AT ALL (Jellyfin should inject the needed movie info by itself anyways i think)
Not possible. Kodi is designed to hunt out nfo files and use them when found

(2021-09-20, 17:01)frostycoin Wrote: - Stop kodi from loading <criticrating> from nfo file into the  "My Rating" / "userRating"
I could not replicate this issue. I copied your nfo file above, and scanned it into my library. UserRating remained unpopulated.

(2021-09-20, 17:01)frostycoin Wrote: - Modify the way Jellyfin creates NFO files to omit the <rating> and <criticrating> fields
- Modify the way Jellyfin creates NFO files, to create proper <ratings> structure
Best to ask at Jellyfin. Maybe switch to a compatible media manager or let Kodi do the scraping for you?

After scanning your nfo file, I then immediately exported to nfo files, and the below is what Kodi spat out. You can see there is no user rating...

xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<movie>
<title>Infinite</title>
<originaltitle>Infinite</originaltitle>
<ratings>
<rating name="default" max="10" default="true">
<value>5.400000</value>
<votes>0</votes>
</rating>
</ratings>
<userrating>0</userrating>
<top250>0</top250>
<outline>Many lives. Unlimited potential.</outline>
<plot>A man discovers that his hallucinations are actually visions from past lives.</plot>
<tagline>Many lives. Unlimited potential.</tagline>
<runtime>1</runtime>
<mpaa>PG-13</mpaa>
<playcount>0</playcount>
<lastplayed></lastplayed>
<id>tt6654210</id>
<uniqueid type="unknown" default="true">tt6654210</uniqueid>
<genre>Action</genre>
<genre>Sci-Fi</genre>
<genre>Thriller</genre>
<country>United States of America</country>
<tag>based on novel or book</tag>
<tag>reincarnation</tag>
<credits>Ian Shorr</credits>
<credits>Todd Stein</credits>
<credits>D. Eric Maikranz</credits>
<director>Antoine Fuqua</director>
<premiered>2021-06-10</premiered>
<year>2021</year>
<status></status>
<code></code>
<aired></aired>
<studio>Di Bonaventura Pictures</studio>
<studio>Closest to the Hole Productions</studio>
<studio>Leverage Entertainment</studio>
<trailer>plugin://plugin.video.youtube/?action=play_video&amp;videoid=rubfbwFmKic</trailer>
<fileinfo>
<streamdetails>
<video>
<codec>h264</codec>
<aspect>1.777778</aspect>
<width>1280</width>
<height>720</height>
<durationinseconds>95</durationinseconds>
<stereomode></stereomode>
</video>
<audio>
<codec>pcm_bluray</codec>
<language>eng</language>
<channels>2</channels>
</audio>
</streamdetails>
</fileinfo>
<actor>
<name>Mark Wahlberg</name>
<role>Evan McCauley</role>
<order>0</order>
<thumb>C:\ProgramData\Jellyfin\Server\metadata\People\M\Mark Wahlberg\folder.jpg</thumb>
</actor>
<actor>
<name>Valerii An</name>
<role>Executive Producer</role>
<order>1</order>
<thumb></thumb>
</actor>
<resume>
<position>0.000000</position>
<total>0.000000</total>
</resume>
<dateadded>2021-09-15 13:44:40</dateadded>
</movie>

A couple of other issues...
UniqueID is wrong. It should be... <uniqueid type="imdb" default="true">tt6654210</uniqueid>
Rating is wrong. It should be... <rating name="imdb" max="10" default="true">
You have multiple Studios which means that Studio Icons (if you use them) will not display.

I strongly urge you to use a compatible media manager.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#4
Thanks for the response both of you, indeed after further investigation i found out that Deleting the NFO files before import still reproduced the same Issue. 
So im thinking its the way that Jellyfin for Kodi is importing into Kodi based on its internal dataset (that probably uses the same structure as the NFO files)
And have thus created an issue on the Jellyfin for Kodi github. (link to github issue)

Is Jellyfin for Kodi not a compatible media manager? 
Or do you mean using another tool to generate the NFO files (Tho it appears that its not just the NFO files that are the problem but rather Jellyfin)
Reply
#5
(2021-09-21, 09:03)frostycoin Wrote: Is Jellyfin for Kodi not a compatible media manager? 
I have never used Jellyfin, but judging by your nfo file, there are some fixes required to be 100% compatible with Kodi.

I don't know how else you are using Jellyfin, but sounds like there is some direct interface between Jellyfin and the Kodi databases?
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#6
(2021-09-21, 09:18)Karellen Wrote:
(2021-09-21, 09:03)frostycoin Wrote: Is Jellyfin for Kodi not a compatible media manager? 
I have never used Jellyfin, but judging by your nfo file, there are some fixes required to be 100% compatible with Kodi.

I don't know how else you are using Jellyfin, but sounds like there is some direct interface between Jellyfin and the Kodi databases?

Yeah i agree they way the NFO files are build are not 100% up to stuff, but i havnt been able to find a way to Modify the way Jellyfin spits out its NFO files (I think it just copies them from TheOpenMovieDatabase)
(Jellyfin is basically plex, but then build on a opensource free version of it)

Indeed there are two ways to interface between kodi and jellyfin (https://jellyfin.org/docs/general/clients/kodi.html
One is a Plugin called "Jellyfin for Kodi" that Injects the files into the Kodi SQL database (with proper paths to network drives etc)
And the other one is called "Jellycon" thats just an addon where you open the addon to browse the library. 

And im using the Jellyfin for Kodi addon so i think they are doing something wrong during their SQL database injection putting the wrong thing in the wrong field (Maybe a faulty regex or something since <criticrating> and userrating both have rating in their name)
So i have put in a issue ticked on github and hopefully someone over there can shed some light on the situation. 
And perhaps other people googleing for the same issue might find this thread and head over there aswell (posted github issue)
Reply
#7
(2021-09-21, 09:03)frostycoin Wrote: Or do you mean using another tool to generate the NFO files (Tho it appears that its not just the NFO files that are the problem but rather Jellyfin)

I have a similar setup to yourself. 
  • Synology NAS hosts content. 
  • Sonarr and Radarr retrieve files
  • Jellyfin used as media server
  • KODI on Apple TV as media center using Jellyfin addon

Where we differ is that I use Tiny Media Manager as my management tool to scrape, generate NFO files and add artwork.  The NFO files conform to the structure optimal for KODI, when Jellyfin scans my library, I can see in Jellyfin web browser as well as KODI the movie/tv ratings.
Reply
#8
I raised a similar issue with Jellyfin and KODI in a separate thread where IMDB Top 250 playlist returns no results.  The rules applied to playlist are either "Top 250 is greater than 0" or "Top 250 is not 0" but finds none of the top 250 films in my library.

However NFO files contains Top 250 rating number and browsing KODI movie library the Top 250 rating flag #<insert rating number> appears next to each of the titles.

I'm going to try removing and re-adding the movie library within Jellyfin addon and see if that changes anything.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi reads NFO file for rating, and it imports the "criticrating" as the "userRating"0