Kodi Community Forum
Req Read tags from arbitrary video files or support local user-defined file name patterns - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Discussions (https://forum.kodi.tv/forumdisplay.php?fid=222)
+--- Forum: Feature Requests (https://forum.kodi.tv/forumdisplay.php?fid=9)
+--- Thread: Req Read tags from arbitrary video files or support local user-defined file name patterns (/showthread.php?tid=343032)



Read tags from arbitrary video files or support local user-defined file name patterns - Crissov - 2019-04-15

As previously explained in the Video Support forum, I'm using a naming pattern for TV episodes, e.g. 1.23 Title.ext for episode #23 in the 1st season, which is not supported by the default patterns. I have edited the regular expressions in AdvancedSettings.xml in my local profile folder accordingly. (It is a trivial change adding just three characters.) However, if I'm sharing a USB drive containing my files with a friend, they either need to make the same edit or rename the files.

One way to solve this would be changing the default regular expressions. I have submitted a pull request on Github to this effect, but maintainers seem to prefer to avoid changing the patterns globally.

Another solution would be allowing the respective XML elements <tvshowmatching/> and <tvmultipartmatching/> in local info files, tvshow.nfo in particular. They would apply to the folder the file is in and recursively to all its subfolders unless overruled by another tvshow.nfo. This could also happen in a separate file, e.g. named pattern.nfo, or a local AdvancedSettings.xml could be parsed and used, probably with a limited set of elements allowed. Whichever poses the least compatibility and implementation problems.

Finally, Leia introduces support for reading metadata stored in tags inside video files, MP4 in particular, which could be relied upon instead. My video files do have such tags (with duplicate data: TVEPISODE = TRACK, TVSEASON = DISCNUMBER, TVSHOW = ALBUM). Alas, on a system running Kodi 18.1 without customized settings, they are still being ignored when their folder is added to the library or scanned again later on. I verified that this is because the files do not match the TV episode naming patterns. If the files are recognized as episodes, the (or at least some) tags are used. I wish Kodi would read supported tags from any arbitrary video file in its media sources.