[webif] Web Interface 1.4.x

Status
Not open for further replies.
Ah. Those of us using tablets/touch screens don't get the benefit of pop-ups.
Yes, it was only chance I was dealing with this thread on the PC last night (I'm on the tablet now) and had a look at the data on box SWMBO was watching downstairs. I stumbled on the pop-ups.

Xkcd has a specific workaround for this issue with alt-text. Might it be possible to add that to webif? (I have no idea what is involved in such coding.)
 
[Deleted Items] folder (or whatever it may have been renamed by the user):

It would be nice if the OPT+ menu for that particular folder didn't offer the options available for usual folders (which are inappropriate anyway), but instead offered an "empty wastebasket" operation. Same would apply to the OPT+ button(s) within the folder.
 
t would be nice if the OPT+ menu for that particular folder didn't offer the options available for usual folders (which are inappropriate anyway), but instead offered an "empty wastebasket" operation. Same would apply to the OPT+ button(s) within the folder.

Yes, but special cases are a PITA for software developers, requiring extra coding and testing and likely extra bugs - so unfortunately we currently rely on end users to know all the special cases :(

If we have special handling for the Dustbin we should also have special cases for the /media directory (don't permit folder creation) and the Flatview folder (No decryption, cropping etc)

With the package structure of the webif - any special coding should be done in the associated package, It would be quite easy and logical for the Undelete package to add an 'Empty Wastebasket' item to the folder menu, but less easy for it to disable menu items added by other packages.

For the Flatview folder should it be be the responsibility of the Flatview package or the Crop (nicesplice) package to know that Crop is not a sensible option within that folder? DetectAds is even trickier since it works unless you use the decrypting/cropping flavours.
 
Quite some time ago there was a thread about managing favourites using the CF ...
[using the Humax UI] - actually creating the favorites list so that the channels appear in the correct order can be a pain.

Would it be possible to create the favourites list "off the box" and load it onto the humax? I assume it's technically possible because a favourites list created on the box can be backed up and restored using webif.
...
and as was replied
The Favourites info. is contained in *.rbk files, e.g. :- /mod/var/backup/auto-2013-Feb-22-18:06.rbk, it is worth remembering that the *.rbk files contain not only any favourites list generated but also the recording schedule list, the favourites list is quite readable, but the recording schedule is not quite so straightforward, ...
You would have to take care not to mess up the format if you edited this file

Now with the advent of Yesterday+1 in the big smoke, my list of favourites has reached 100 items, which is a limit written into the Humax blob. However the limit only applies when adding to a favourites group and is not checked afterwards (and apparently exceeding the limit doesn't blow up the software, say by overflowing some fixed buffer). So I was looking for a work-around, ideally without going into Maintenance mode and casting SQL commands to modify the Humax databases.

Edit The check is applied even if the relevant group already has more than 100 entries.

I looked at editing a copy of the autosaved .rbk file to insert Yesterday+1 into a favourites group after Yesterday; it would be a tiresome job because each data row includes an index field that would have to be incremented for every row after the inserted one.

The code to parse this file and restore the schedule and favourites data to pending copies of the relevant database tables (to replace the actual ones at startup) is in webif/lib/rsv.class in the restore method of the rsv class. Rather than start from scratch, I thought it would be both reasonable and much faster to modify that code.

I decided that a row should be allowed to have index "-" to mean that the restore process must assign it an index value one greater than the previous row and then increment all subsequent index values. Favourites are apparently saved into the file in ascending index order: rsv's matching backup method extracts favourites using a SQL order by eFavGroup, favIdx modifier and saves them in the same order, so I relied on that.

There is a test at line 1233 where if no index value has been saved it is set to 0. This didn't help my problem and I couldn't see how it would be helpful or appropriate in general: if more than one row has index 0 the restore will fail through violating index uniqueness. No doubt there is some case where it might make sense so I left it in my modified code.

Here is a difference listing against rsv.class from WebIf 1.4.4-1:
Diff:
--- rsv.class.org    2018-04-30 18:30:16.616194000 +0000
+++ rsv.class    2018-11-26 20:44:10.291106447 +0000
@@ -1213,6 +1213,8 @@
     )}

     set grp 0
+    set inc 0
+    set lastidx 1
     foreach line $data {
         set vals [split $line "\t"]

@@ -1230,7 +1232,13 @@

         lassign $vals x group type chan idx

-        if {$idx eq ""} { set idx 0 }
+        if {$idx eq ""} {
+            set idx 0
+        } elseif {$idx eq "-"} {
+            set idx $lastidx
+            incr inc
+        }
+        set lastidx $idx

         if {$grp != $group} {
             set grp $group
@@ -1253,7 +1261,7 @@
             insert into
             pending.fav(favIdx, hSvc, eFavGroup, eSvcType)
             values(%s, %s, %s, %s);
-        } $idx $hsvc $group $type
+        } [expr {$idx == 0 ? $idx : $idx + $inc}] $hsvc $group $type
     }

     system restartpending

Can something like this be included in the WebIf package?
 
Last edited by a moderator:
Can something like this be included in the WebIf package?
Definitely. Inserting a zero for an auto-increment column usually makes the SQL database pick the next free value - I don't remember why the "" case is there, it may have been to support an older backup format that did not include indices; that seems likely given that index is the last field.

Later: Yes, that's what it is. The index was not originally saved so to support loading backup files from before, the index is set to zero which makes sqlite3 allocate the next available index.

Here's the change where the index was added:

https://github.com/hummypkg/webif/commit/895dda6deeb95800eef41de2b84dc7a4eee52964
 
Last edited:
Definitely. Inserting a zero for an auto-increment column usually makes the SQL database pick the next free value
... The index was not originally saved so to support loading backup files from before, the index is set to zero which makes sqlite3 allocate the next available index.
...
So, in the case I wanted, a missing index would have generated the next available index which would most likely conflict with the index on the next line of data; but for antique compatibility the logic should support a missing index in the same way.

As an additional feature, "-" (perhaps better: "+") can signal that the index should be one greater than the last, and subsequent indexes should be incremented by one.
 
Feature Request

Would it be possible to add a flag to to folders in the webif browser (similar to the optional unwatched count), this time indicating if there is a _duplicates folder to potentially delete?


Sent from my iPad using Tapatalk
 
Last edited:
I decided that a row should be allowed to have index "-" to mean that the restore process must assign it an index value one greater than the previous row and then increment all subsequent index values. Favourites are apparently saved into the file in ascending index order: rsv's matching backup method extracts favourites using a SQL order by eFavGroup, favIdx modifier and saves them in the same order, so I relied on that.

...

Can something like this be included in the WebIf package?

I've implemented this just slightly differently to your proposed patch, but it will be in the next webif release.

The commit is here:

https://github.com/hummypkg/webif/commit/9de13741c860c2efbae1de947a991ed76d2745a9
 
I've implemented this just slightly differently to your proposed patch, but it will be in the next webif release.

The commit is here:

https://github.com/hummypkg/webif/commit/9de13741c860c2efbae1de947a991ed76d2745a9

Thanks. It seems to be equivalent provided that the input file has either no index values or index values possibly with '-', which ought to be the case given that the former case is historical.

Should the combination case be handled, in which lastidx would have to be set from the actual index assigned by the DBMS if the input line had no index value? Or at least move lines 1243-4 into the conditional clause:
Code:
		} else {
			if {$idx eq "-"} {
				set idx $lastidx
				incr inc
			}
			set lastidx $idx
			incr idx $inc 
		}
 
Should the combination case be handled, in which lastidx would have to be set from the actual index assigned by the DBMS if the input line had no index value? Or at least move lines 1243-4 into the conditional clause:
I'll move the lines, thanks. I'd be astounded if anyone did try and load such an old backup file and even more if they knew about and tried this new feature in combination with it but it's neater to group the lines like this.
 
  • Like
Reactions: /df
While I'd still like to get to the bottom of it, I've been experimenting with adding functionality to nugget to retrieve this information directly from the tuner routines.. seems promising.
...
Is there any more progress on this?

One reason for asking is that it would be good to have a redring-style optimisation for the HD Fox.

Another is that I have observed the status command displaying more slightly confused output. While a copy to external USB storage is running on the HDR where the MICOM and main board clocks drift out of sync, I get (NB after resyncing but not rebooting)
Code:
# /mod/boot/tzget; date
Micom Timestamp: 1545147591 - Tue Dec 18 15:39:51 2018
GMT
Tue Dec 18 15:39:52 GMT 2018
humaxhdr# status
Playing Dynasties/Dynasties_20181209_1600
Playing Dynasties/Dynasties_20181209_1600
VFD: 4seven HD
Idle: 00:03:37
# status
Playing Dynasties/Dynasties_20181209_1600
Playing Dynasties/Dynasties_20181209_1600
VFD: 4seven HD
Idle: 00:03:37
#
and after deleting the flag file /tmp/.rractive, so that status uses lsof rather than redring
Code:
# status
Playing Dynasties/Dynasties_20181209_1600
Recording Dynasties/Dynasties_20181209_1600
VFD: 4seven HD
Idle: 00:04:12
#
Although no doubt the Humax blob is effectively playing (to decode) and recording when it's copying, it would be good to have a way of distinguishing this so that the "Playing {copied programme]" message doesn't override the "Watching [something else]" message.
 
I did have a search but couldn't find anywhere better to put this Minor Bug Report.
On the Humax/TV interface list of recordings the icons show a yellow corner symbol for un-viewed recordings - the 'new' flag. This is true of both thumbnail icons and the 'lightning flash' icon used where there was some oddity with the recording.
I noticed today in WebIf, while reapplying the new flag to some films, that where the lightning flash is in use the yellow corner is not present. Confused me a bit as I thought I had failed to set the flag on a file but when I went into the Opt menu it was offering to remove the flag, so I had set it.
Obviously not a biggie but if someone is tinkering perhaps they could fix it.
 
Feature Request
Would it be possible to add a flag to to folders in the webif browser (similar to the optional unwatched count), this time indicating if there is a _duplicates folder to potentially delete?

1547900507827.png

Here you go - it's in webif beta 1.4.4-3 if you want to try it now and will be in the 1.4.5 release.
 
I did have a search but couldn't find anywhere better to put this Minor Bug Report.
On the Humax/TV interface list of recordings the icons show a yellow corner symbol for un-viewed recordings - the 'new' flag. This is true of both thumbnail icons and the 'lightning flash' icon used where there was some oddity with the recording.
I noticed today in WebIf, while reapplying the new flag to some films, that where the lightning flash is in use the yellow corner is not present. Confused me a bit as I thought I had failed to set the flag on a file but when I went into the Opt menu it was offering to remove the flag, so I had set it.
Obviously not a biggie but if someone is tinkering perhaps they could fix it.
It will be fixed in the 1.4.5 release, thanks for the report.
 
@af123
If you use the WebIf's Rename function to set a new Medialist Title or New Synopsis, it doesn't include the 0x15 prefix on the string.
This usually doesn't seem to matter... except when you get to something like "Les Misérables" when it does.
Without the 0x15, it displays the UTF-8 literally, which makes it show funny characters (technical term!).

The Humax software seems to put these 0x15's in the .hmt file by default.
 
Status
Not open for further replies.
Back
Top