2019-08-17, 17:57
Hi,
this is a mix of a bug report and feature request. If there is a more appropriate sub-forum, please let me know and move this thread.
Description
Kodi is able to read episode files that contain more than one episode, i.e. multi-episodes (see https://kodi.wiki/view/Naming_video_file...i-Episodes )
An example for this would be S01E01-S01E02.mov.
When I export my library (Settings -> Media -> Export library) to get *.nfo files, the generated NFO is technically invalid.
Why are some NFO files invalid?
Because NFO files are actually just XML files (which is why every NFO file begins with "<?xml version="1.0" ... ?>") they must only contain 1 root element.
Kodi however simply concats <episodedetails> tags for all episodes in one file. This means that there are multiple root elements which is not correct.
What does the XML standard say?
https://www.w3.org/TR/REC-xml/#NT-document states:
What consequences does this have?
XML libraries that stick to the specification are not able to correctly parse the NFO file. This includes QDomDocument of the Qt framework.
Workarounds
For example MediaElch simply adds a "fake" root element around all <episodedetails> tags to conform to the XML standard.
This is actually just string insertion (see code on GitHub).
Kodi Wiki
Kodi's wiki is also inconsistent (I think), see https://kodi.wiki/view/NFO_files/TV_show...isode_Tags
The text says:
Request
If feasible, I would like Kodi to add a single root element around all <episodedetails> tags, e.g. <episodes> or similar.
I didn't find a similar issue in this forum or on GitHub, yet.
Regards,
Andre
PS: I didn't know whether I should post this issue on GitHub or not. So here it is :-)
Edit: I'm using Kodi v18.3 but this issue exist in v17 and v16 as well.
this is a mix of a bug report and feature request. If there is a more appropriate sub-forum, please let me know and move this thread.
Description
Kodi is able to read episode files that contain more than one episode, i.e. multi-episodes (see https://kodi.wiki/view/Naming_video_file...i-Episodes )
An example for this would be S01E01-S01E02.mov.
When I export my library (Settings -> Media -> Export library) to get *.nfo files, the generated NFO is technically invalid.
Why are some NFO files invalid?
Because NFO files are actually just XML files (which is why every NFO file begins with "<?xml version="1.0" ... ?>") they must only contain 1 root element.
Kodi however simply concats <episodedetails> tags for all episodes in one file. This means that there are multiple root elements which is not correct.
What does the XML standard say?
https://www.w3.org/TR/REC-xml/#NT-document states:
Quote:There is exactly one element, called the root, or document element, no part of which appears in the content of any other element.
What consequences does this have?
XML libraries that stick to the specification are not able to correctly parse the NFO file. This includes QDomDocument of the Qt framework.
Workarounds
For example MediaElch simply adds a "fake" root element around all <episodedetails> tags to conform to the XML standard.
This is actually just string insertion (see code on GitHub).
Kodi Wiki
Kodi's wiki is also inconsistent (I think), see https://kodi.wiki/view/NFO_files/TV_show...isode_Tags
The text says:
Quote:For multi-part episodes, simply add multiple <episodedetails> XML blocks in succession.However the table states for <episodedetails> -> multiple: No
Request
If feasible, I would like Kodi to add a single root element around all <episodedetails> tags, e.g. <episodes> or similar.
I didn't find a similar issue in this forum or on GitHub, yet.
Regards,
Andre
PS: I didn't know whether I should post this issue on GitHub or not. So here it is :-)
Edit: I'm using Kodi v18.3 but this issue exist in v17 and v16 as well.