[mythtv-users] Problem with ttvdb.py

Mark Perkins perkins1724 at hotmail.com
Fri Feb 17 03:25:59 UTC 2017

On 16 February 2017 9:01:42 AM Anthony Giggins <seven at seven.dorksville.net> wrote:

> On 16 February 2017 at 00:29, Michael Wisniewski <mikewiz38 at gmail.com>
> wrote:
>> On Wed, Feb 8, 2017 at 4:56 PM, Anthony Giggins <
>> seven at seven.dorksville.net> wrote:
>>> On 9 February 2017 at 08:19, Michael Wisniewski <mikewiz38 at gmail.com>
>>> wrote:
>>>> I'm missing some information about TV Season and Episode numbers in Myth
>>>> and decided to do a bit of research into why.  It looks like you would
>>>> run...
>>>> $ mythmetadatalookup --refresh-all
>>>> In order to fill in this information.  But there are still some
>>>> recordings that do not fill the information in, but yet it exists in tvdb.
>>>> When exploring this a bit further, I get a lot of output from the command,
>>>> but this one little snip is of interest.  It looks like it executes this:
>>>> 2017-02-08 16:12:27.926741 I  Running Grabber:
>>>> /usr/share/mythtv/metadata/Television/ttvdb.py -l en -a US -N 272472
>>>> Pups Save a Blimp; Pups Save a Chili Cook-Out
>>>> 2017-02-08 16:12:28.325963 I  Running Grabber:
>>>> /usr/share/mythtv/metadata/Television/ttvdb.py -l en -a US -C 272472
>>>> 2017-02-08 16:12:28.576924 I  Result Found, Season 0 Episode 0
>>>> 2017-02-08 16:12:28.576983 I  Returning Metadata Results: PAW Patrol 0 0
>>>> If I look the information up in tvdb, it is definitely in there as "Paw
>>>> Patrol" S04xE01 and S04xE02, but mythmetadatalookup says it returns 0.
>>>> So then, I try to execute the ttvdb command...
>>>> $ /usr/share/mythtv/metadata/Television/ttvdb.py -r -i -N 272472 "Pups
>>>> Save a Blimp"
>>>> And the information it returns back is 'returned zero results'.  I
>>>> thought it was a bit strange, so I substitute the series id (272472) with
>>>> the series name, and I am starting to get some information back.  For
>>>> example...
>>>> /usr/share/mythtv/metadata/Television/ttvdb.py -r -i -N "Paw Patrol"
>>>> "Pups Save a Blimp"
>>>> This will then return information about the particular episode.
>>>> Now "Paw Patrol" may be a bad example because the half hour(?) show has
>>>> two episodes in it, so the recording will place a semi-colon to separate
>>>> the two.  But, this is happening on more episodes than just this one.
>>>> I think what the problem is that ttvdb searches on the tvdb series ID
>>>> instead of the name.  I was wondering if anybody was having a similar
>>>> experience or if this is a known issue...or something that I'm doing wrong.
>>>> Thanks!
>>> This is Correct, Mythtv and ttvdb have no concept of double episodes, the
>>> usual response is this should be corrected at the Listing/EPG provider,
>>> I had put some thought into writing a script to be run from a userjob to
>>> split double episodes but I haven't progressed from there
>> I did some changes to myth over the weekend and still thinking about these
>> double episodes.  It seems like this is my issue that I'm having.
>> You talked about writing a script....did you start?  What is your logic
>> behind it?
>> I'm thinking about writing something where if the episode number is empty
>> and a semi-colon in the subtitle, insert another row into the database and
>> split the subtitle up between the two rows.  I just don't know what kind of
>> damage I might do to myth by doing this, since I haven't checked out the
>> database schema that much...
> No this never got past a thought, it used to be somewhat possible with the
> old nuvexport; As you could mark the start and end of the first episode in
> the recording in the mythtv editor, run nuvexport to export the first
> episode, then do the opposite for the second episode which would dump both
> episodes out to mp4 or avi (which could be inserted back into recordings if
> you so wish) but nuvexport last time I tried was no longer functional.
> On the other hand you could just cut it in the middle and be done with it,
> the odds of that being the correct cut point would be hit or miss, or
> perhaps use the same logic as mythtv and cut it in the middle with a soft
> rollover pad (I usually use a 10 min pad to the end of the first episode
> and start or the second)
> As per Mike P's Comments it has been mentioned on the shepherd mailing
> lists but This still has not been implemented
> https://groups.google.com/forum/?hl=en#!topic/shepherd-list/0MTtS3FszQc
> Cheers,
> Anthony
> ----------
> _______________________________________________

This was the way I went -  As I am using shepherd (Australian xmltv grabber) to generate an xmltv file anyway I cobbled together a script that checks for the colon in the subtitle and modifies the xmltv file before it gets pulled into MythTV. Saves trying to modify the database and helps with duplicate detection as well.

The logic I used was:
- if subtitle present check ttvdb for match using title and subtitle.
- if valid match then update (or add if missing) season, episode and description.
- if no match check subtitle for semicolon
- if semicolon split and check each part for match in ttvdb.
- if at least one of the splits match then replace the single entry with the split entries
- if no match leave as is.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20170217/21cffcd6/attachment.html>

More information about the mythtv-users mailing list