[mythtv-users] Fwd: Fwd: Re: channel4 hd has no eit - cross-eit

UB40D ub40dd at googlemail.com
Sun Sep 12 21:16:46 UTC 2021


On Thu, 9 Sept 2021 at 18:29, John <jksjdevelop at gmail.com> wrote:

>
> Ok I have done some testing.
>
> The EPG is certainly being stored in the database as UTC so the News
> which is shown at 19:00 BST is stored as starting at 18:00.
>
> The old version of cross-eit with date = dateobj +
> datetime.timedelta(seconds=time.altzone) writes the correct times to the
> database during BST.
>
> JSW version with start="20210915190000 +0000" writes incorrect times to
> the database.
>
> Nemo version with start="20210915180000 +0000" writes correct times to
> the database during BST.
>


I am still getting off-by-one-hour failures, though only for SOME channel 4
HD recordings, not all, and this is all very confusing. I have also been
doing some debugging but I can't figure out where this extra hour
difference comes from. Here is what I've got to so far.

Ground truth: Karate Kid II was broadcast on Channel 4 HD today
(2021-09-12) starting at 1350 UTC+1.
Indeed the channel 4 website says, at
https://www.channel4.com/programmes/the-karate-kid-part-ii , "Sun 12 Sep,
1.50pm"

It appeared in my Myth schedule (using the old cross-eit at
https://pastebin.com/d51VUASq ) as starting at 1450, hence still with the
error. The recording scheduled from the myth GUI would have missed the
first hour.

The above "old" cross-eit produced

<programme channel="hd.channel4.com" start="20210912135000" stop=
"20210912160000"><title>The Karate Kid Part II</title>

(start time correct IFF you assume UTC+1; incorrect in UTC+0)


The JSW 2.0 cross-eit produced

  <programme channel="hd.channel4.com" start="20210912135000" stop=
"20210912160000">

    <title>The Karate Kid Part II</title>

(start time correct IFF you assume UTC+1; incorrect in UTC+0)


The JSW 2.1 cross-eit produced


  <programme channel="hd.channel4.com" start="20210912135000 +0000" stop=
"20210912160000 +0000">

    <title>The Karate Kid Part II</title>

(start time in UTC+0 that's definitely incorrect: if anything it ought to
be 1250)



Last night, a cron job ran these two commands:


/home/tv/bin/cross-eit.py -o /tmp/export.xml 19211,"hd.channel4.com"

/usr/bin/mythfilldatabase --refresh-all --verbose xmltv --file --sourceid 1
--xmlfile /tmp/export.xml


and the first of them produced this file (still untouched)...


-rw-rw-r-- 1 tv tv 216039 Sep 12 04:30 /tmp/export.xml

and the following database content:


mysql> select p.chanid, c.name, p.starttime, p.endtime, p.title from
program as p, channel as c where p.chanid=c.chanid and p.title
like("%karate kid part ii");

+--------+--------------+---------------------+---------------------+------------------------+

| chanid | name         | starttime           | endtime             | title
                |

+--------+--------------+---------------------+---------------------+------------------------+

|  18320 | Channel 4    | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

|  19211 | Channel 4    | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

|  19212 | Channel 4    | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

|  19213 | Channel 4    | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

|  19214 | Channel 4    | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

|  19216 | Channel 4    | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

|  18311 | Channel 4+1  | 2021-09-12 13:50:00 | 2021-09-12 16:00:00 | The
Karate Kid Part II |

|  18312 | Channel 4+1  | 2021-09-12 13:50:00 | 2021-09-12 16:00:00 | The
Karate Kid Part II |

|  18314 | Channel 4+1  | 2021-09-12 13:50:00 | 2021-09-12 16:00:00 | The
Karate Kid Part II |

|  18316 | Channel 4+1  | 2021-09-12 13:50:00 | 2021-09-12 16:00:00 | The
Karate Kid Part II |

|  31200 | Channel 4 HD | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

+--------+--------------+---------------------+---------------------+------------------------+

11 rows in set (0.29 sec)


Here the start time on channels 19211 and 31200 is 1250 rather than 1350,
but if it's true that the database always contains UTC+0 then that's fine,
that would be equivalent to 1350 UTC+1, hence still the correct time. Yet
the GUI showed a start time of 1450. Why??



Further experimentation: I then imported the xml produced by JSW 2.1 (the
one with a start time of 1350 UTC+0, which is INCORRECT) with the following
command:


 /usr/bin/mythfilldatabase --refresh-all --verbose xmltv --file --sourceid
1 --xmlfile export-jsw21.xml


and, after that, the same query resulted in


mysql> select p.chanid, c.name, p.starttime, p.endtime, p.title from
program as p, channel as c where p.chanid=c.chanid and p.title
like("%karate kid part ii");

+--------+--------------+---------------------+---------------------+------------------------+

| chanid | name         | starttime           | endtime             | title
                |

+--------+--------------+---------------------+---------------------+------------------------+

|  31200 | Channel 4 HD | 2021-09-12 13:50:00 | 2021-09-12 16:00:00 | The
Karate Kid Part II |

|  18320 | Channel 4    | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

|  19211 | Channel 4    | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

|  19212 | Channel 4    | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

|  19213 | Channel 4    | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

|  19214 | Channel 4    | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

|  19216 | Channel 4    | 2021-09-12 12:50:00 | 2021-09-12 15:00:00 | The
Karate Kid Part II |

|  18311 | Channel 4+1  | 2021-09-12 13:50:00 | 2021-09-12 16:00:00 | The
Karate Kid Part II |

|  18312 | Channel 4+1  | 2021-09-12 13:50:00 | 2021-09-12 16:00:00 | The
Karate Kid Part II |

|  18314 | Channel 4+1  | 2021-09-12 13:50:00 | 2021-09-12 16:00:00 | The
Karate Kid Part II |

|  18316 | Channel 4+1  | 2021-09-12 13:50:00 | 2021-09-12 16:00:00 | The
Karate Kid Part II |

+--------+--------------+---------------------+---------------------+------------------------+

11 rows in set (0.29 sec)


You will note that now 19211 stays at 1250 (correct in UTC+0) but 31200 has
gone to 1350 (incorrect in UTC+0, although unsurprising as that's what the
xml said). Now what does the GUI say? The program guide still says the
start time is 1450 local time (incorrect).


My unanswered questions:


1) why, if the imported XML says 1350 (not qualified with a time zone),
mythfilldatabase translates that to 1250 UTC+0?

(Educated guess: because myth assumes that an unqualified date is in local
time, which would make a lot of sense. But then, if myth is smart enough to
translate from local time to UTC, why do we ever have off-by-one errors? By
this logic, these should never occur.)


2) why does cross-eit JSW 2.1 output 1350 UTC+0 into the XML if the EIT
stored in the database (already in UTC+0) says 1250? Shouldn't cross-eit
just repeat 1250 and just add UTC+0?


3) what's the proper way to fix all this? I can add and subtract 1 hour as
well as anyone else, but by now it's totally unclear under which
circumstances it should be done.


4) is there a way to see (and possibly even log) what the on-air EIT
originally said, before being imported in the database as UTC+0? Did the
EIT mention a time zone or was it in local time?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20210912/de61d6d6/attachment.htm>


More information about the mythtv-users mailing list