[mythtv-commits] Ticket #13481: Missed recordings caused by EIT guide update

MythTV noreply at mythtv.org
Fri Sep 6 13:48:11 UTC 2019

#13481: Missed recordings caused by EIT guide update
 Reporter:  Klaas de Waal    |          Owner:  Klaas de Waal
     Type:  Patch - Bug Fix  |         Status:  assigned
 Priority:  minor            |      Milestone:  31.0
Component:  MythTV - EIT     |        Version:  Master Head
 Severity:  low              |     Resolution:
 Keywords:  EIT              |  Ticket locked:  0

Comment (by Klaas de Waal):

 The solution implemented here does fix the existing implementation of the
 single recording and it does this for EIT program updates only.

 To capture the knowledge about this and to serve as an inspiration for
 future development, possibly but not necessarily by me, here is a summary
 of the issues and the alternatives.

 **Change the primary key for table program**\\
 The table program has chanid plus starttime as the primary key. If the
 table program would have a primary key that is independent of the data
 then a reference to an entry in the table program would remain valid even
 if the starttime changes.

 **Re-implement the "Single Recording"**\\
 For all other types of recording the starttime is not used as a key and
 hence the problem of changing starttimes does not exist. For instance,
 with a power rule it is possible to search for a program with a specific
 title in a time interval. It should be possible to implement the "Single
 Recording" in this way.  This would solve the problem both for EIT and for
 XMLTV program guide updates.

 **What about XMLTV/mythfilldatabase**\\
 The program guide update code that is used by mythfilldatabase is much
 simpler and does not try to identify the program that is being updated.
 This is not done because the XMLTV/Schedules Direct data is always
 complete so you can always add a program to the guide. In contrast, EIT
 information can come in bits and pieces so there it is essential to
 identify which program the update is intended for.\\
 It is possible to merge the guide update code so that the XMLTV updates
 are also processed by the EIT program matching code.\\
 However, a better solution is probably to re-implement the Single
 Recording with a search rule, as described above.

 **Use MySQL schema for field update propagation**\\
 As mentioned by Philipp Hahn in the email thread:\\
 ''Both MySQL and PostgreSQL support "ON UPDATE CASCADE", but the Schema
 definition all lack the required "REFERENCES $table($column)" statements
 for that to work. Then the DBMS would do the job for you, faster and
 less error prone and guaranteed to follow the ACID properties.
 This is an intriguing feature which I did not know before.
 However, adding a database rule like this would always update the fields
 in table record; the fix in the code is selective so that it only updates
 the table record when there is a single recording. Also, a fix in code is
 much more flexible than a database schema change. Another consideration is
 that if database rules like this are used it does need to be commented in
 the C++ code that depends on it otherwise the code will be, even more than
 now, incomprehensible to most mortal beings.

Ticket URL: <https://code.mythtv.org/trac/ticket/13481#comment:1>
MythTV <http://www.mythtv.org>
MythTV Media Center

More information about the mythtv-commits mailing list