Changes between Initial Version and Version 2 of Ticket #11541


Ignore:
Timestamp:
May 15, 2013, 1:27:11 AM (7 years ago)
Author:
Raymond Wagner
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11541

    • Property Type changed from Patch - Bug Fix to Bug Report - General
  • Ticket #11541 – Description

    initial v2  
    11XMLTV grabbers such as tv_grab_ch_search can not provide endtime for programs. For programs spanning midnight, the endtime is incorrectly reconstructed: none of these programs ends before 00:00:00 UTC, some later. For the CET time zone with daylight savings time (my time zone), this translates into 2am local time (CET-UTC = +2hrs). It appears that the starttime of the first program starting after 00:00:00 UTC is chosen rather than the first starting after 00:00:00 local time. From the mysql DB:
    2 
     2{{{
    33mysql> SELECT chanid, starttime, endtime, title FROM program WHERE starttime BETWEEN CONVERT_TZ('2013-05-17 22:10:00', 'SYSTEM', 'UTC') AND CONVERT_TZ('2013-05-18 23:59:59', 'SYSTEM', 'UTC') AND chanid = '10056' ORDER BY starttime LIMIT 6;
    44
     
    1313|  10056 | 2013-05-18 02:00:00 | 2013-05-18 03:40:00 | Bauer, ledig, sucht... |
    1414+--------+---------------------+---------------------+------------------------+
    15 
     15}}}
    1616(I apologize, I do not do the channel programming.)
    1717
    1818I suspect mythtv/libs/libmythtv/programdata.cpp ProgramData::fix_end_times is to blame, starting line 1172:
    19 
     19{{{
    2020        querystr = QString("SELECT chanid, starttime, endtime FROM program "
    2121                           "WHERE starttime BETWEEN '%1 00:00:00'"
     
    2525                           .arg(endtime.left(10))
    2626                           .arg(chanid);
    27 
     27}}}
    2828This seems to be where the following program is queried. Emulating this in mysql for the given case:
    29 
     29{{{
    3030mysql> SELECT chanid, starttime, endtime, title FROM program WHERE starttime BETWEEN '2013-05-18 00:00:00' AND '2013-05-18 23:59:59' AND chanid = '10056' ORDER BY starttime LIMIT 1
    3131    -> ;
     
    3535|  10056 | 2013-05-18 00:00:00 | 2013-05-18 01:00:00 | Sexy Live-Strip Girls |
    3636+--------+---------------------+---------------------+-----------------------+
    37 
     37}}}
    3838
    3939Should the times not be converted to UTC?
    40 
     40{{{
    4141        querystr = QString("SELECT chanid, starttime, endtime FROM program "
    4242                           "WHERE starttime BETWEEN CONVERT_TZ('%1 00:00:00', 'SYSTEM', 'UTC')"
     
    4646                           .arg(endtime.left(10))
    4747                           .arg(chanid);
    48 
     48}}}
    4949Emulating this in mysql for the given case:
    50 
     50{{{
    5151mysql> SELECT chanid, starttime, endtime, title FROM program WHERE starttime BETWEEN CONVERT_TZ('2013-05-18 00:00:00', 'SYSTEM', 'UTC') AND CONVERT_TZ('2013-05-18 23:59:59', 'SYSTEM', 'UTC') AND chanid = '10056' ORDER BY starttime LIMIT 1;
    5252+--------+---------------------+---------------------+------------------+
     
    5555|  10056 | 2013-05-17 22:05:00 | 2013-05-17 23:00:00 | The Walking Dead |
    5656+--------+---------------------+---------------------+------------------+
     57}}}