From e3da17ca6c3817ada4e25887c6918ecb1022d34f Mon Sep 17 00:00:00 2001 From: MymsMan Date: Thu, 14 May 2020 15:59:40 +0100 Subject: [PATCH] use s-crid:e-crid as key for recorded programmes --- webif/lib/epg.class | 5 ++--- webif/lib/rsv.class | 49 ++++++++++++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/webif/lib/epg.class b/webif/lib/epg.class index a52b56b..72156cc 100644 --- a/webif/lib/epg.class +++ b/webif/lib/epg.class @@ -206,9 +206,9 @@ epg method scheduled {{debug 0}} { set p 0 foreach key [list \ "$service_id:$event_id" \ - "$channel_hsvc:$event_id" \ + "$channel_hsvc:$event_id" \ [string tolower "$service_id:$channel_crid$series_crid"] \ - [string tolower "$service_id:$channel_crid$event_crid"] \ + [string tolower "$channel_crid$series_crid:$channel_crid$event_crid"] \ ] { if {$debug} {puts "Check key ($key)"} if {[dict exists $rsvlookup $key]} { @@ -567,4 +567,3 @@ proc {epg channellist} {{field usLcn}} { return $channels } - diff --git a/webif/lib/rsv.class b/webif/lib/rsv.class index 6ab2220..e38ec45 100644 --- a/webif/lib/rsv.class +++ b/webif/lib/rsv.class @@ -208,7 +208,7 @@ rsv method channel_name {} { rsv method szsttime_stamp {} { set spaced [regsub {^(....)(..)(..)(..)(..)(..).*} \ $szsttime {\1 \2 \3 \4 \5 \6}] - + if {[catch { set stamp [clock scan $spaced -format "%Y %m %d %H %M %S"] }]} { @@ -744,7 +744,8 @@ proc {rsv lookuptab} {} { foreach tab {tbl_reservation pending} { set res [[rsv dbhandle] query " select usSvcId, usevtid, ucCRIDType, szCRID, - ucRecKind, aulEventToRecordInfo + ucRecKind, aulEventToRecordInfo, + szRecordedProgCrid from $tab left join channel.TBL_SVC on $tab.hSvc = channel.TBL_SVC.hSvc where ersvtype <= 3 @@ -766,23 +767,36 @@ proc {rsv lookuptab} {} { } else { continue } - set aul $rec(aulEventToRecordInfo) - - if {[string length $aul]} { - for {set i 0} {$i < [string length $aul]} {incr i 16} { - binary scan [string range $aul $i $($i + 15)]\ - iiii service start end event_id - set records([\ - string tolower "$service:$event_id"]) $p - } - } else { + foreach r [split $rec(szRecordedProgCrid) "|"] { + if {$r != {}} { + set records([string tolower "\ + $rec(szCRID):\ + [string range $r 1 end]"]) "R" + } + } - set records([\ - string tolower "$rec(usSvcId):$rec(szCRID)"]) $p - } + set aul $rec(aulEventToRecordInfo) + + if {[string length $aul]} { + for {set i 0} {$i < [string length $aul]} {incr i 16} { + binary scan [string range $aul $i $($i + 15)]\ + iiii service start end event_id + set records([\ + string tolower "$service:$event_id"]) $p + } + + } else { + set records([\ + string tolower "$rec(usSvcId):$rec(szCRID)"]) $p + } } } + # Add all skipped epsisodes for all series + set skiplist [rsv _skiplist] + foreach skip $skiplist { + set records($skip) "X" + } return $records } @@ -1440,7 +1454,7 @@ proc {rsv allevents} {{xota 0}} { incr start 86400 incr end 86400 - + # Sun == 0 set day [clock format $start -format "%w"] @@ -1469,7 +1483,7 @@ proc {rsv allevents} {{xota 0}} { {*}$trailer] } } - + } return $xevents @@ -1700,4 +1714,3 @@ proc {rsv reassert_skips} {{debug false}} { rsv commit } } -