Unable to Schedule "No Foreigners Here - 100% British

phit03

Member
Trying to schedule the above program both via both Remote Scheduling and the Web Interface returns "Error encountered while scheduling: not enough arguments for all format specifiers" I've tried on 2 different boxes with the same result and different versions of the same program in the EPG both series link and single program. I can't try via the real Box EPG as I'm in Spain at the moment.

Anyone else got this problem?
 

Black Hole

May contain traces of nut
I tested it for you - I get the same via WebIF scheduling although other programmes (same service) seem to schedule OK, and the programme in question schedules OK via the SUI.
 

prpr

Well-Known Member
Presumably it is the % character that is causing a problem.
Indeed. The root of the problem appears to be here (Jim is such an annoying language):
Code:
humax# diff -u /mod/webif/lib/rsv.class~ /mod/webif/lib/rsv.class
--- /mod/webif/lib/rsv.class~
+++ /mod/webif/lib/rsv.class
@@ -445,7 +445,7 @@
  set args(nsttime)  [$event get start]
  set args(nduration)  [$event get duration]
  set args(usevtid)  [$event get event_id]
-  set args(szevtname)  "\025[$event get name]"
+  set args(szevtname)  [regsub -all {%} "\025[$event get name]" {%%}]
  set args(eReady)  30
  lassign [system padding] args(ulPreOffset) args(ulPostOffset)
 
OP
P

phit03

Member
Indeed. The root of the problem appears to be here (Jim is such an annoying language):
Code:
humax# diff -u /mod/webif/lib/rsv.class~ /mod/webif/lib/rsv.class
--- /mod/webif/lib/rsv.class~
+++ /mod/webif/lib/rsv.class
@@ -445,7 +445,7 @@
  set args(nsttime)  [$event get start]
  set args(nduration)  [$event get duration]
  set args(usevtid)  [$event get event_id]
-  set args(szevtname)  "\025[$event get name]"
+  set args(szevtname)  [regsub -all {%} "\025[$event get name]" {%%}]
  set args(eReady)  30
  lassign [system padding] args(ulPreOffset) args(ulPostOffset)

I tried it on my Foxsat-HDR via the web-if and that was successful. That seems to use Jim as well, different code I guess but I seem to remember the Foxsat version was based on the HDRFOX version.
 

af123

Administrator
Staff member
Indeed. The root of the problem appears to be here (Jim is such an annoying language):
I doubt that's the root of the problem but it's a good temporary fix. I'll have a look at it when I can. It's probably the subsequent database operation that's failing.

Horses for courses, I find Jim a very nice language to use, particularly with the class extension.
 

prpr

Well-Known Member
I doubt that's the root of the problem but it's a good temporary fix. I'll have a look at it when I can. It's probably the subsequent database operation that's failing.
I'm pretty convinced that is the problem as that's where it fails (tested by removing/substituting etc.). But it doesn't do the same thing when run interactively. I'm almost tempted to say it's some odd bug in Jim, but I don't know nearly enough to be certain.
Horses for courses, I find Jim a very nice language to use, particularly with the class extension.
I don't dispute it has its nice features. It's just that it seems to me that I'm never quite sure what it's going to do, especially with things like this variable substitution. Needless to say, the manual doesn't help with any of this problem. The notation is odd and there aren't nearly enough examples either.
 

af123

Administrator
Staff member
No, not a bug. The problem is due to the fact that the sqlite3 query method can take a string with % tokens in it for expansion, e.g.:

Code:
$database_handle query {insert into people(forename, surname) values('%s', '%s')} "Fred" "Smith"

and line 282 in rsv.class does:

Code:
  $rsvdb query $query

If the value of $query includes a % then it expects an additional argument for the value to be filled in.

I've fixed it in rsv.class by expanding the existing replacement which was already being done for ' characters:

Code:
-- rsv.class~
+++ rsv.class
@@ -267,8 +267,8 @@

  set vals {}
  foreach field $fields {
-  # Escape any quotes embedded in the data.
-  regsub -all {'} [$self get $field] {''} f
+  # Escape any quotes and percents embedded in the data.
+  regsub -all {['%]} [$self get $field] {&&} f
  lappend vals "'$f'"
  #lappend vals "'[$self get $field]'"
  }

Travelling at the moment so will not be able to upload a new package until later this weekend.
 
Top