XMLTV / xmltv

Utilities to obtain, generate, and post-process TV listings data in XMLTV format
GNU General Public License v2.0
275 stars 93 forks source link

Augment Rules for Series / Episode in sub-title #127

Closed philled closed 3 years ago

philled commented 3 years ago

XMLTV Version?

0.6.1-1

XMLTV Component?

tv_augment

What did you expect to happen?

Is it possible to use any of the tv_augment rules to clean up XMLTV data that has "Series x Episode y" data like this in the sub-title and move it to episode-num rather than sub-title?

  <programme start="20210102002000 +1100" stop="20210102005100 +1100" channel="abccomedy.free.au">
    <title lang="en">The Thick of It</title>
    <sub-title lang="en">Series 4, Episode 8</sub-title>
    <desc lang="en">The final reckoning. Every dog has its day, but as the fallout from the inquiry takes its toll, the everyday problems of government continue unabated.</desc>
    <credits>
      <actor>Chris Langham</actor>
      <actor>Peter Capaldi</actor>
    </credits>
    <category lang="en">Comedy</category>
    <category lang="en">Comedies</category>
    <episode-num system="xmltv_ns">3 . 7 . </episode-num>
    <subtitles type="teletext" />
    <rating>
      <value>MA</value>
    </rating>
  </programme>

Did you see any warnings/errors?

Negative repeat count does nothing at /usr/share/perl5/XMLTV/Augment.pm line 3319.

What other software are you using?

Operating System: "Ubuntu 20.04.1 LTS

Perl Version: 5.30.0-9

honir commented 3 years ago

You can use the _extract_numbering_fromepisode rule which as the sample configuration file says: Rule A5.2 - Extract series/episode numbering found in <sub-title>.

You may also want to set _update_existingnumbering if you want to overwrite any existing "episode-num".

But note that won't make any difference in the example you give, since episode-num "3 . 7 . " is the correct representation of "Series 4, Episode 8"
(see: link to DTD)