Correctly display minute/minutes

This commit is contained in:
prpr 2023-07-02 10:37:26 +01:00
parent 44c52143a7
commit 1d243c989b
2 changed files with 10 additions and 4 deletions

View File

@ -156,10 +156,14 @@ if {$type eq "ts"} {
puts "<font class=also>(Scheduled: [clock format \ puts "<font class=also>(Scheduled: [clock format \
[expr {[$ts get schedstart] + [$ts get scheddur]}] \ [expr {[$ts get schedstart] + [$ts get scheddur]}] \
-format "%c %Z"])</font>" -format "%c %Z"])</font>"
set duration [$ts duration]
set durmins [format "minute%s" $($duration == 1 ? "" : "s")]
set resume [$ts get resume]
set resmins [format "minute%s" $($resume == 1 ? "" : "s")]
puts "</td> puts "</td>
</tr><tr> </tr><tr>
<th>Duration</th> <th>Duration</th>
<td>[$ts duration] minute(s). <td>$duration $durmins.
<font class=also>(Scheduled: [expr {[$ts get scheddur] / 60}]) <font class=also>(Scheduled: [expr {[$ts get scheddur] / 60}])
</font></td> </font></td>
</tr><tr> </tr><tr>
@ -167,8 +171,8 @@ if {$type eq "ts"} {
<td>[$ts get status]</td> <td>[$ts get status]</td>
</tr><tr> </tr><tr>
<th>Resumes</th> <th>Resumes</th>
<td>[expr {[$ts get resume] / 60}] minutes into recording. <td>[expr {$resume / 60}] $resmins into recording.
[progressbar $([$ts get resume] * 100 / [$ts duration 1])] [progressbar $($resume * 100 / [$ts duration 1])]
</td> </td>
</tr><tr> </tr><tr>
<th>Size</th> <th>Size</th>

View File

@ -33,7 +33,9 @@ puts {
<fieldset class=cleft style="margin: 0 1em 1em 1em"> <fieldset class=cleft style="margin: 0 1em 1em 1em">
<legend>VLC Player</legend> <legend>VLC Player</legend>
} }
puts "<span class=also>Now playing: $rfile, [$ts duration] minutes.</span>" set duration [$ts duration]
set mins [format "minute%s" $($duration == 1 ? "" : "s")]
puts "<span class=also>Now playing: $rfile, $duration $mins.</span>"
puts { puts {
<div id=vlc></div> <div id=vlc></div>