Fix erroneous ffprobe output when .ts file not DLNA indexed

This commit is contained in:
prpr 2024-03-10 14:01:22 +00:00
parent a4d7dfaea6
commit 244b3e46cf

View File

@ -185,41 +185,41 @@ if {$ts != 0} {
<th>Size</th>
<td>$sz</td>
"
lassign [$ts dlnaloc] url
if {$url ne ""} {
lassign [$ts dlnaloc] url
if {$url ne ""} {
puts "</tr><tr><th>DLNA&nbsp;URL</th>
<td><a href=\"$url\">$url</a></td>"
<td><a href=\"$url\">$url</a></td>"
}
puts "
puts "
</tr><tr>
<th>Files</th>
<td>
"
set fileset [$ts fileset]
puts -nonewline "<img class=collapser x=fileset id=xfileset class=va
set fileset [$ts fileset]
puts -nonewline "<img class=collapser x=fileset id=xfileset class=va
src=/img/tree/plusonly.png>"
puts -nonewline "[llength $fileset] file"
if {[llength $fileset] != 1} { puts -nonewline "s" }
puts -nonewline " in set."
puts "<div id=fileset class=hidden><ul>"
foreach f $fileset {
puts "<li>[file tail $f] ([pretty_size [file size $f]])</li>"
}
puts "</ul></div>"
puts -nonewline "[llength $fileset] file"
if {[llength $fileset] != 1} { puts -nonewline "s" }
puts -nonewline " in set."
puts "<div id=fileset class=hidden><ul>"
foreach f $fileset {
puts "<li>[file tail $f] ([pretty_size [file size $f]])</li>"
}
puts "</ul></div>"
puts "</td></tr>"
puts "</td></tr>"
eval_plugins browsetsfile
eval_plugins browsetsfile
puts "<tr>
puts "<tr>
<th>Flags</th>
<td>[set flags [$ts get flags]]</td>
</tr>
"
if {[$ts get bookmarks]} {
puts "
if {[$ts get bookmarks]} {
puts "
<tr>
<th>Bookmarks</th>
<td>[$ts get bookmarks] @ [join [lmap i [$ts bookmarks 1] {
@ -228,10 +228,10 @@ if {[$ts get bookmarks]} {
</td>
</tr>
"
}
}
puts "<div class=hidden id=file>$file</div>"
puts {
puts "<div class=hidden id=file>$file</div>"
puts {
<script type=text/javascript>
var file = $('#file').text();
$('button').button();
@ -267,7 +267,7 @@ $('img.rollimg').hover(
);
</script>
}
}
} else {
# Otherwise, for a general file.
@ -283,23 +283,23 @@ $('img.rollimg').hover(
</tr>"
}
set hasffmpeg 0
proc ffinfo {} {
puts "<tr>
<th>Info</th>
<td class=pre id=ffmpeg>
<img src=/img/spin.gif><i>Loading...</i>
</td>
</tr>"
<th>Info</th>"
if {$::hasffmpeg} {
puts " <td class=pre id=ffmpeg>
<img src=/img/spin.gif><i>Loading...</i>
</td>"
} else {
puts "<td>Encrypted</td>"
}
puts "</tr>"
}
set hasffmpeg 0
if {$type eq "ts"} {
if {"ODEncrypted" ni $flags && $url eq ""} {
ffinfo
set hasffmpeg 1
}
if {$url ne ""} {
puts [format {
<script type="text/javascript">
@ -307,8 +307,14 @@ if {$type eq "ts"} {
</script> } $url]
}
} elseif {$type ne "bad"} {
if {[string tolower [file extension $file]] != ".ts"} {
set hasffmpeg 1
} else {
if {![exec /mod/bin/stripts -qE [file rootname $file]]} {
set hasffmpeg 1
}
}
ffinfo
set hasffmpeg 1
}
puts "