MediaElch icon indicating copy to clipboard operation
MediaElch copied to clipboard

[Kodi] Update nfo file "version"

Open bugwelle opened this issue 6 years ago • 7 comments

With the latest Kodi versions, a lot has happened regarding nfo files, e.g. <rating> now has a max attribute and more. We should update our nfo handling.

See: https://kodi.wiki/view/NFO_files/Movies

bugwelle avatar Jul 11 '18 17:07 bugwelle

Most tags have been updated and are ready to use. I'll move this issue to the v2.6.4 milestone because GUI elements won't be updated for v2.6.2

bugwelle avatar Sep 05 '19 16:09 bugwelle

Most tags have been updated and are ready to use. I'll move this issue to the v2.6.4 milestone because GUI elements won't be updated for v2.6.2

Does this mean that the NFO files will now ultimately be fixed in v2.6.4 instead of v2.6.2?

monisriz avatar Sep 06 '19 16:09 monisriz

This means that MediaElch does not generate invalid (or old) xml tags. For example MediaElch does not allow users to add multiple ratings through the GUI but we will nevertheless use the "new" Kodi syntax which does allow multiple ones:

<ratings>
  <rating ...>
  </rating>
  <rating ...>
  </rating>
</ratings>

We create the code above vor v17/v18 instead of just a single <rating> tag.

MediaElch is able to read Kodi v17/v18 tags but we cannot show all of them in the GUI, yet. This includes multiple ratings, unique id's other than IMDb and TVDb, the <order> tag for actors, etc.

I just don't have enough time to fix this all of this this month. v2.6.0 has been released more than half a year ago and I don't want to postpone the new version any further. :-)

#719 is still part of v2.6.2 and I will update all tags that are not compatible with v17 and v18.

bugwelle avatar Sep 06 '19 16:09 bugwelle

Sounds good. Multiple ratings (e.g. Rotten Tomatoes) would be a great addition for the future..

monisriz avatar Sep 06 '19 16:09 monisriz

Apart from the "max" attribute, I think the name attribute and value tag needs slight adjustment too.

This is how Kodi generates the nfo upon export (multiple files). The name attribute is all lowercase and "value" property has 6 digits after decimal (for accuracy?? not sure..). I know that ME doesn't support multiple ratings right now but I pasted the whole section for completeness.

    <ratings>
        <rating name="imdb" max="10" default="true">
            <value>7.100000</value>
            <votes>129216</votes>
        </rating>
        <rating name="themoviedb" max="10">
            <value>7.100000</value>
            <votes>3263</votes>
        </rating>
    </ratings>

======================================= And this is how ME generates nfo file. Not the difference in the name attribute case (IMDb vs imdb) and value property decimal places.

    <ratings>
        <rating default="true" name="IMDb">
            <value>7.1</value>
            <votes>129216</votes>
        </rating>
    </ratings>

======================================= On the initial scan (using Kodi "use local files" option in scraper settings) with ME generated nfo file scans in to the library. However, the ratings/votes change and get updated in the library through some addon (e.g. LightIMDb). Now if the user exports the nfo file via Kodi export setting, the following happens:

    <ratings>
        <rating name="IMDb" max="10">
            <value>4.100000</value>
            <votes>12345</votes>
        </rating>
        <rating name="imdb" max="10" default="true">
            <value>7.100000</value>
            <votes>129216</votes>
        </rating>
    </ratings>

======================================= To test this I manually changed the rating value/votes to simulate the changing nature of them. And then let the LightIMDb Ratings addon update the library as usual. Then exported the library via Kodi export function. On subsequent ratings updates, only the Kodi's version of ratings tag ("name=imdb") updates and ME generated "name=IMDb" is not read/updated.

monisriz avatar Sep 17 '19 23:09 monisriz

Max attribute added for ratings tag. *.nfo files for movies should now be on par with how Kodi (v18.4) does it at this point.

monisriz avatar Sep 29 '19 19:09 monisriz

MediaElch now supports multiple ratings in the UI.

bugwelle avatar Mar 22 '21 10:03 bugwelle