use s-crid:e-crid as key for recorded programmes

This commit is contained in:
Bob Buxton 2020-05-14 15:59:40 +01:00 committed by HummyPkg
parent b99327a562
commit e3da17ca6c
2 changed files with 33 additions and 21 deletions

View File

@ -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
}

View File

@ -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
}
}