Changes between Initial Version and Version 2 of Ticket #11541
- Timestamp:
- May 15, 2013, 1:27:11 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #11541
-
Property
Type
changed from
Patch - Bug Fix
toBug Report - General
-
Property
Type
changed from
-
Ticket #11541 – Description
initial v2 1 1 XMLTV 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 {{{ 3 3 mysql> 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; 4 4 … … 13 13 | 10056 | 2013-05-18 02:00:00 | 2013-05-18 03:40:00 | Bauer, ledig, sucht... | 14 14 +--------+---------------------+---------------------+------------------------+ 15 15 }}} 16 16 (I apologize, I do not do the channel programming.) 17 17 18 18 I suspect mythtv/libs/libmythtv/programdata.cpp ProgramData::fix_end_times is to blame, starting line 1172: 19 19 {{{ 20 20 querystr = QString("SELECT chanid, starttime, endtime FROM program " 21 21 "WHERE starttime BETWEEN '%1 00:00:00'" … … 25 25 .arg(endtime.left(10)) 26 26 .arg(chanid); 27 27 }}} 28 28 This seems to be where the following program is queried. Emulating this in mysql for the given case: 29 29 {{{ 30 30 mysql> 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 31 31 -> ; … … 35 35 | 10056 | 2013-05-18 00:00:00 | 2013-05-18 01:00:00 | Sexy Live-Strip Girls | 36 36 +--------+---------------------+---------------------+-----------------------+ 37 37 }}} 38 38 39 39 Should the times not be converted to UTC? 40 40 {{{ 41 41 querystr = QString("SELECT chanid, starttime, endtime FROM program " 42 42 "WHERE starttime BETWEEN CONVERT_TZ('%1 00:00:00', 'SYSTEM', 'UTC')" … … 46 46 .arg(endtime.left(10)) 47 47 .arg(chanid); 48 48 }}} 49 49 Emulating this in mysql for the given case: 50 50 {{{ 51 51 mysql> 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; 52 52 +--------+---------------------+---------------------+------------------+ … … 55 55 | 10056 | 2013-05-17 22:05:00 | 2013-05-17 23:00:00 | The Walking Dead | 56 56 +--------+---------------------+---------------------+------------------+ 57 }}}