[mythtv-commits] Ticket #10734: Dynamic Variable Evaluation for Power Search (Extension)

MythTV noreply at mythtv.org
Thu May 17 23:05:58 UTC 2012

#10734: Dynamic Variable Evaluation for Power Search (Extension)
 Reporter:  mmm1976@…         |          Owner:
     Type:  Patch - Feature   |         Status:  infoneeded_new
 Priority:  minor             |      Milestone:  unknown
Component:  MythTV - General  |        Version:  0.25
 Severity:  medium            |     Resolution:
 Keywords:                    |  Ticket locked:  0

Comment (by gigem):

 Replying to [comment:2 mmm1976@…]:
 > First: Yes, I have tried this. But it doesn't work for my show, because
 sometimes there are 2 occurences of the show within 24h (e.g. the first
 starts at 7PM, the second on 6.55PM on the next day). I tried everything
 (and hat loooong chats about the scheduler with sphery in the chat). The
 only thing I wanted was a timeslot recording rule which is tolerant for
 time-shifts. Of course it's just an example and it can be used for much

 There is a hidden time for Find Daily (and Weekly) rules that defines when
 the "day" begins.  If you choose the 7pm showing when you create the
 rrule, the day will begin at 7pm and the scheduler will always try to
 record the 7pm showing before falling back to 6:55pm showing the next day.

 > Second: I don't see how this could do the same. The variables are filled
 with the information of the selected show in the program guide. The sense
 behind is that e.g. something like {STARTTIME} is dynamically evaluated to
 36000 if the show which was selected in the EPG starts at 10AM. (How can I
 access data from scheduled programs, I haven't scheduled yet?)
 > Third: Not the SQL clause is the same, the expression is the same.
 {STARTTIME} depends on the show you selected and is a variable which is
 then evaluated. No way you could do a static filter for it.
 > You store custom-edit examples with variables like {TITLE} or
 {STARTTIME} and these variables are replaced by real data coming from the
 program guide before the rule is stored in the recodings table. There was
 no mechanism in mythtv which would have allowed something like this.

 There is something I don't think you understand.  When a rule is created,
 and also when it is edited later, values from the program on which you
 chose to bring up the schedule rule editor are copied into the rule.  IOW,
 your variables (or at least the important ones that matter) are already
 there in the record table.  For example, the program starttime is one of
 those values.  You can then create a "Fuzzy starttime" filter by using the
 following SQL:

   ABS(TIME_TO_SEC(TIMEDIFF(TIME(program.starttime), RECTABLE.starttime)))
 < 900

 If you then set a rule type to "record at any time on any channel" or
 "record at any time on this channel" and enable the filter, you
 effectively create a daily recording rule that will match starttime +/- 15
 minutes.  Please note that there isn't a GUI yet for users to add their
 own filters.

 You can do the same type of thing with custom rules and stored examples.
 Unfortunately, there is a problem I ran into while testing.  The sanity
 test that must be passed before you are allowed to create a recording rule
 doesn't account for the record table references.  I'll have to see what I
 can do about that.

Ticket URL: <http://code.mythtv.org/trac/ticket/10734#comment:4>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center

More information about the mythtv-commits mailing list