From 9de13741c860c2efbae1de947a991ed76d2745a9 Mon Sep 17 00:00:00 2001 From: HummyPkg Date: Sun, 9 Dec 2018 21:59:05 +0000 Subject: [PATCH] Allow favourites to be inserted manually into the sequence within a backup file --- webif/lib/rsv.class | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/webif/lib/rsv.class b/webif/lib/rsv.class index 1c77547..e9d7c1a 100755 --- a/webif/lib/rsv.class +++ b/webif/lib/rsv.class @@ -1213,6 +1213,8 @@ proc {rsv restore} {file} { )} set grp 0 + set inc 0 + set lastidx 1 foreach line $data { set vals [split $line "\t"] @@ -1230,7 +1232,16 @@ proc {rsv restore} {file} { lassign $vals x group type chan idx - if {$idx eq ""} { set idx 0 } + if {$idx eq ""} { + # This is to support old format backup files where + # the favourite index is not present. + set idx 0 + } elseif {$idx eq "-"} { + set idx $lastidx + incr inc + } + set lastidx $idx + incr idx $inc if {$grp != $group} { set grp $group