Good news.
To fill in what previous posters no doubt understood, the
genre
member of a
ts
is normally populated from the output of the
hmt -p
command, which doesn't provide any error code: therefore the only way to check that the output is valid is by sanity checking each value. This isn't done at present, which explains how the
title
member can be set to "Invalid HMT file, /media/My Video/Who Dares Wins_20201223_2200.hmt", as displayed to OP.
In the OP's webif version, what was happening is that, while trying to display the line corresponding to each recording (l.330
foreach file $files { entry "$dir/$file" }
), the
proc entry {file} {{i 0}}
routine failed for the suspect recording because the genre info for the recording is invalid, and there is no error check or trap protecting the genre code. As above, in this case all other HMT-derived data was junk as well.
This check replacing l.138
set omenu opt
in
/mod/webif/html/browse/index.jim
should make the Webif display treat a .ts file with an invalid HMT as if the HMT was missing (ie, like a generic .ts video file):
Code:
if {[$ts get definition] eq ""} {
set type gen
set ts 0
set img Video_Other
set omenu oopt
} else {
set omenu opt
}
In this routine, the object representing the recording is instantiated in a way that assumes it is a .ts with a valid .hmt, so the preferable approach of failing to instantiate (returning 0 instead) would have unwanted side-effects. The value assigned to the
definition
member is created in the
hmt
program (ie not read directly from the file), and is always either "SD" (Radio, or SD flag set) or "HD" (HD flag set); if the HMT is invalid or missing,
definition
is set to the empty string.