From 9da2cb0c3f815e5aa180d73da384bf61694ff58a Mon Sep 17 00:00:00 2001 From: MymsMan Date: Wed, 22 Nov 2023 16:35:48 +0000 Subject: [PATCH] Handle recording file missing --- webif/plugin/schedchk/schedchk.jim | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/webif/plugin/schedchk/schedchk.jim b/webif/plugin/schedchk/schedchk.jim index 11e7e2f..9380ac5 100755 --- a/webif/plugin/schedchk/schedchk.jim +++ b/webif/plugin/schedchk/schedchk.jim @@ -325,7 +325,6 @@ proc rsvscan {} { } # # Should be recording now, check if it is -# proc chkActive {resv dresv rstatus} { global now svcmap svcdef log "Already started? Status = $rstatus - $dresv" 1 @@ -348,11 +347,12 @@ proc chkActive {resv dresv rstatus} { # need to check whether it has actually started and schedule alternate if not recording if {$file !=0} { - set ifsz [file size "$file.ts"] + set ifsz 0 + catch {set ifsz [file size "$file.ts"]} set cfsz $ifsz for {set i 0} {$i < 5} {incr i} { sleep 1 - set cfsz [file size "$file.ts"] + catch {set cfsz [file size "$file.ts"]} if {$cfsz > $ifsz} {break} } if {!($cfsz > $ifsz)} { @@ -396,8 +396,12 @@ proc chkActive {resv dresv rstatus} { set ocname [$other get channel_name] set dother "[clock format $ostart -format {%d/%m/%y %H:%M}] [clock format $odur -format {%H:%M}] === $oname === $ocname" # attempt to schedule the alternate (always 1-off) - schedule $other $dother "Alternate for non-recording" - conflict-list + if {[$other scheduled]} { + log "*** Alternate for non-recording Already scheduled *** $dother === " 1 + } else { + schedule $other $dother "Alternate for non-recording" + conflict-list + } return } else { log "Unable to schedule alternate for non-recording programme -$dresv " 0