[webif] Web Interface 1.4.x

Status
Not open for further replies.
af123
There are a couple of horrid bugs in the notification log processing which causes it to display lines out of order (primarily because Jim arrays are not sequenced or sorted - they are just random), or missing altogether because they have a '-' in the name or elsewhere on the log line.
For example, this in /mod/tmp/notify.log:
Code:
12/01/2018 02:05:04 - Automatically upgraded package multimode from 1.0.1 to 1.0.2
12/01/2018 02:05:05 - Automatically upgraded package boot-settings from 1.0.2 to 1.0.3 (Update settings)<br><a href="https://hummy.tv/forum/threads/7678/">https://hummy.tv/forum/threads/7678/</a>
12/01/2018 02:05:05 - Automatically upgraded package tunefix-update from 1.0.32 to 1.0.33
Your Humax crashed and some packages may have been disabled as a precaution.
  ... view the crash.log for more details.
02/02/2018 01:31:09 - Automatically upgraded package boot-settings from 1.0.3 to 1.0.4 (Update settings)<br><a href="https://hummy.tv/forum/threads/7678/">https://hummy.tv/forum/threads/7678/</a>
02/02/2018 01:31:57 - Automatically upgraded package sweeper from 2.1.5-9 to 2.1.5-10 (Add %bfolder token)<br><a href="http://hummy.tv/forum/threads/5138/">http://hummy.tv/forum/threads/5138/</a>
02/02/2018 01:31:58 - Automatically upgraded package tunefix from 1.6.6 to 1.6.7
02/02/2018 01:31:58 - Automatically upgraded package epg from 1.2.7 to 1.2.8 (Fix disappearing EPG)
02/02/2018 01:31:58 - Automatically upgraded package webif from 1.4.2-8 to 1.4.2-10<br><a href="https://hummy.tv/forum/threads/7712/">https://hummy.tv/forum/threads/7712/</a>
turns into this:
Code:
02/02/2018 01:31:09 - Automatically upgraded package boot-settings from 1.0.3 to 1.0.4 (Update settings)<br><a href="https://hummy.tv/forum/threads/7678/">https://hummy.tv/forum/threads/7678/</a>
02/02/2018 01:31:58 - Automatically upgraded package epg from 1.2.7 to 1.2.8 (Fix disappearing EPG)
Your Humax crashed and some packages may have been disabled as a precaution.
  ... view the crash.log for more details.
12/01/2018 02:05:04 - Automatically upgraded package multimode from 1.0.1 to 1.0.2
02/02/2018 01:31:58 - Automatically upgraded package tunefix from 1.6.6 to 1.6.7
12/01/2018 02:05:05 - Automatically upgraded package boot-settings from 1.0.2 to 1.0.3 (Update settings)<br><a href="https://hummy.tv/forum/threads/7678/">https://hummy.tv/forum/threads/7678/</a>
12/01/2018 02:05:05 - Automatically upgraded package tunefix-update from 1.0.32 to 1.0.33
02/02/2018 01:31:58 - Automatically upgraded package webif from 1.4.2-8 to 1.4.2-10<br><a href="https://hummy.tv/forum/threads/7712/">https://hummy.tv/forum/threads/7712/</a>
02/02/2018 01:31:57 - Automatically upgraded package sweeper from 2.1.5-9 to 2.1.5-10 (Add %bfolder token)<br><a href="http://hummy.tv/forum/threads/5138/">http://hummy.tv/forum/threads/5138/</a>
Here is a fix:
Code:
humax /mnt/hd2/mod/webif/include # diff notify.jim~ notify.jim
--- notify.jim~
+++ notify.jim
@@ -16,23 +16,29 @@
 set lines {}
 set seen {}
+set i 0
 foreach line [split [file read /mod/tmp/notify.log] "\n"] {
-       set rest [lassign [split $line -] date]
+       set rest [join [lassign [split $line -] date] -]
        if {$rest eq ""} { set rest $date }
        if {[dict exists $seen $rest]} {
                incr seen($rest)
        } else {
                set seen($rest) 1
        }
-       set lines($rest) "$line"
        set mul $seen($rest)
        if {$mul > 1} {
-               append lines($rest) " ($mul instances)"
+               append line " ($mul instances)"
        }
+       incr i
+       set lines($rest) [list $i "$line"]
 }
-foreach {line msg} $lines {
-       puts $msg
+foreach {k v} $lines {
+       lappend logs $v
+}
+set logs [lsort -integer -index 0 $logs]
+foreach line $logs {
+        puts [lindex $line 1]
 }
 puts {
 
Last edited:
I guess [dict values] does the equivalent to [dict keys], but it ain't documented (grumble). Looks OK to me though.
Well, the inverse - it returns the values as a list (effectively what you were doing with the loop).
I'll publish the updated webif package shortly.
 
Well, the inverse - it returns the values as a list (effectively what you were doing with the loop).
What I meant was that "dict keys returns a list of keys" compared to "dict values returns a list of values" is equivalent if you susbstitue "values" for "keys".
I didn't mean that [dict keys] did the same thing as [dict values] (fairly obviously, as there would be no point!).
 
af123
Suggest change in WebIf to cope with impending move of ITV3 from COM4 to PSB2:
Code:
humax /mnt/hd2/mod/webif/html/diag # diff -u mux.jim~ mux.jim
--- mux.jim~
+++ mux.jim
@@ -83,14 +83,14 @@
                        "Channel 4 HD" -
                        "BBC ONE HD" { set mux "PSB3/BBC B" }
                        "5 USA" -
-                       "ITV3" { set mux "COM4/SDN" }
+                       "ITV2 +1" { set mux "COM4/SDN" }
                        "Really" -
                        "Dave" { set mux "COM5/ARQ A" }
                        "4Music" -
                        "Yesterday" { set mux "COM6/ARQ B" }
                        "BBC NEWS HD" { set mux "COM7/ARQ C" }
                        "5STAR+1" -
-                       "QVC + 1 HD" { set mux "COM8/ARQ D" }
+                       "BBC FOUR HD" { set mux "COM8/ARQ D" }
                }
        }
        puts "<td>$mux</td>"
 
af123
And again. Is there a better way to stop these being overlooked?
Yes, I could decouple this database and give you write access. With your work on tunefix-update, you're the most likely person to spot the need for changes.
 
I have retuned my t2 and restored my recordings schedule. I have some series set up which don't currently have future episodes in epg. Will my schedule catch next episodes within the expiry window?
 
I have retuned my t2 and restored my recordings schedule. I have some series set up which don't currently have future episodes in epg. Will my schedule catch next episodes within the expiry window?
Yes, providing the broadcaster uses the same series crid, sometimes they use a new crid for a new season of a series
 
Yes, providing the broadcaster uses the same series crid, sometimes they use a new crid for a new season of a series
Room 101 is restarting its short (9 episode?) series tonight after a break of 2-3 weeks. I'd left the reservation in place but it didn't pick up the continuation and I had to reschedule the reservation and delete the old one.
This wasn't even a mid-season break as such, just a glitch because of other events (sport aid or something was one week). So don't rely on the series linking, keep an eye on the schedules - I use the 'unanchored' reservation as a reminder as it still holds the channel, day and time to check on.
 
Yes, providing the broadcaster uses the same series crid, sometimes they use a new crid for a new season of a series
Room 101 is restarting its short (9 episode?) series tonight after a break of 2-3 weeks. I'd left the reservation in place but it didn't pick up the continuation and I had to reschedule the reservation and delete the old one.
This wasn't even a mid-season break as such, just a glitch because of other events (sport aid or something was one week). So don't rely on the series linking, keep an eye on the schedules - I use the 'unanchored' reservation as a reminder as it still holds the channel, day and time to check on.
Tonight's episode is the one postponed from a few weeks ago (episode 6), and seems to have a different series crid. Episode 9 was still scheduled for next Friday on the original series link on my HDR T2, so looks like a mistake at the Beeb.
 
Tonight's episode is the one postponed from a few weeks ago (episode 6), and seems to have a different series crid. Episode 9 was still scheduled for next Friday on the original series link on my HDR T2, so looks like a mistake at the Beeb.
Ah. I set (reset) it last night, so next week's wasn't in the epg then. I'll have a look later and see how things are panning out.

Edit: My new setting for the series has picked up next week's episode (6 April) so either they've changed the crid to the new one or something else is happening.

Aaaagghhhh, these broadcasters are useless
Yes, though the BBC are not usually this inept.
 
Last edited:
I did a Schedule Restore yesterday on one of my boxes following a re-scan on PSB3.
I have Real-Time-Scheduling enabled so was surprised to see it needed a reboot as all the events had been put in to the Pending queue.
I'd have expected it to put them into the normal event queue like everything else does with RTS enabled.
Does this need work, or did I do something wrong (or not wait for something)?
 
I did a Schedule Restore yesterday on one of my boxes following a re-scan on PSB3.
I have Real-Time-Scheduling enabled so was surprised to see it needed a reboot as all the events had been put in to the Pending queue.
I'd have expected it to put them into the normal event queue like everything else does with RTS enabled.
Does this need work, or did I do something wrong (or not wait for something)?
Packages need to be updated to work with RTS, it is not automatic
This may have slipped through the cracks but does it also need the reboot to enable the favourites lists? RTS for favourites would probably not be worth the development effort.
 
Status
Not open for further replies.
Back
Top