Skip to content

Commit

Permalink
ttvdb: Various fixes
Browse files Browse the repository at this point in the history
1. ttvdb: Update "Fixer Upper" test cases with wildcards
"Lastupdated" field has changed, and seems likely to change, so make it a
wildcard match. "Thumbauthor" field has also changed.
2. Update "NOVA: Eclipse Over America" test case
This appears to have moved from episode 18 to episode 11 and had updates
to the description and other metadata.
3. Ignore banner of just  "http://thetvdb.com/banners/"
4. ignore user rating of 0
5. correct handingly of genre
They are a list of "<item>..</item>".
6. Add new test case: ttvdb.py -l en -a GB -C 330432
This had some regressions compared to v29.0 which are now fixed, so add a test case.

Fixes #13130

Signed-off-by: Peter Bennett <pbennett@mythtv.org>
(cherry picked from commit 09090e1)
  • Loading branch information
ijc authored and bennettpeter committed Sep 25, 2017
1 parent 1c6bad9 commit ed43561
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 9 deletions.
8 changes: 4 additions & 4 deletions mythtv/bindings/python/MythTV/ttvdb/XSLT/tvdbCollection.xsl
Expand Up @@ -53,9 +53,9 @@
</xsl:for-each>
</certifications>
</xsl:if>
<xsl:if test="./genre/text() != ''">
<xsl:if test="./genre">
<categories>
<xsl:for-each select="tvdbXpath:stringToList(string(./genre))">
<xsl:for-each select="./genre/item">
<xsl:element name="category">
<xsl:attribute name="type">genre</xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select="normalize-space(.)"/></xsl:attribute>
Expand All @@ -82,7 +82,7 @@
<xsl:if test="./zap2it_id/text() != ''">
<tmsref><xsl:value-of select="normalize-space(zap2it_id)"/></tmsref>
</xsl:if>
<xsl:if test="./siteRating/text() != ''">
<xsl:if test="./siteRating/text() != '0'">
<userrating><xsl:value-of select="normalize-space(siteRating)"/></userrating>
</xsl:if>
<xsl:if test="./siteRatingCount/text() != ''">
Expand Down Expand Up @@ -139,7 +139,7 @@
</xsl:element>
</xsl:when>
</xsl:choose>
<xsl:if test="./banner/text() != ''">
<xsl:if test="./banner/text() != '' and ./banner/text() != 'http://thetvdb.com/banners/'">
<xsl:element name="image">
<xsl:attribute name="type">banner</xsl:attribute>
<xsl:attribute name="url"><xsl:value-of select="normalize-space(banner)"/></xsl:attribute>
Expand Down
50 changes: 45 additions & 5 deletions mythtv/programs/scripts/metadata/Television/ttvdb.py
Expand Up @@ -432,6 +432,13 @@
<certifications>
<certification locale="us" name="TV-PG"/>
</certifications>
<categories>
<category type="genre" name="Action"/>
<category type="genre" name="Adventure"/>
<category type="genre" name="Crime"/>
<category type="genre" name="Mystery"/>
<category type="genre" name="Science-Fiction"/>
</categories>
<studios>
<studio name="Space"/>
</studios>
Expand Down Expand Up @@ -474,15 +481,15 @@
Dvddiscid:
Id:5463514
Imdbid:
Lastupdated:1451954464
Lastupdated:...
Lastupdatedby:447800
Productioncode:
Seriesid:281053
Showurl:
Siterating:0
Siteratingcount:0
Thumbadded:
Thumbauthor:1
Thumbauthor:...
Cast:Chip Gaines, Joanna Gaines
Runtime:45
Title:Fixer Upper
Expand Down Expand Up @@ -608,9 +615,9 @@
<item>
<title>NOVA</title>
<subtitle>Eclipse Over America</subtitle>
<description>On August 21, 2017, millions of Americans will witness the first total solar eclipse to cross the continental United States in 99 years. As in all total solar eclipses, the moon will block the sun, revealing its ethereal outer atmosphereits coronain a wondrous celestial spectacle. While hordes of citizens prepare to flock to the eclipse’s path of totality,</description>
<description>On August 21, 2017, millions of Americans witnessed the first total solar eclipse to cross the continental United States in 99 years. As in all total solar eclipses, the moon blocked the sun and revealed its ethereal outer atmosphereits coronain a wondrous celestial spectacle. While hordes of citizens flocked to the eclipse’s path of totality, scientists, too, staked out spots for a very different reason: to investigate the secrets of the sun’s elusive atmosphere. During the eclipse’s precious seconds of darkness, they gathered new clues on how our sun works, how it can produce deadly solar storms, and why its atmosphere is so hot. NOVA investigates the storied history of solar eclipse science, and joins both seasoned and citizen-scientists alike as they don their eclipse glasses, tune their telescopes, and behold the Eclipse Over America.</description>
<season>44</season>
<episode>18</episode>
<episode>11</episode>
<certifications>
<certification locale="us" name="TV-PG"/>
</certifications>
Expand All @@ -628,8 +635,12 @@
<language>en</language>
<year>2017</year>
<releasedate>2017-08-21</releasedate>
<people>
<person job="Guest Star" name="Craig Sechler"/>
<person job="Director" name="Martin Gorst"/>
</people>
<images>
<image type="screenshot" url="http://thetvdb.com/banners/episodes/76119/6240639.jpg" thumb="http://thetvdb.com/banners/_cache/episodes/76119/6240639.jpg"/>
<image type="screenshot" url="http://thetvdb.com/banners/episodes/76119/6286436.jpg" thumb="http://thetvdb.com/banners/_cache/episodes/76119/6286436.jpg"/>
<image type="coverart" url="http://www.thetvdb.com/banners/seasons/76119-44.jpg" thumb="http://www.thetvdb.com/banners/_cache/seasons/76119-44.jpg"/>
<image type="coverart" url="http://www.thetvdb.com/banners/seasons/76119-44-2.jpg" thumb="http://www.thetvdb.com/banners/_cache/seasons/76119-44-2.jpg"/>
<image type="fanart" url="http://www.thetvdb.com/banners/fanart/original/76119-1.jpg" thumb="http://www.thetvdb.com/banners/_cache/fanart/original/76119-1.jpg" width="1920" height="1080"/>
Expand All @@ -640,6 +651,35 @@
</metadata>
0
>>> sys.argv = shlex.split('ttvdb.py -l en -a GB -C 330432')
>>> main()
<?xml version='1.0' encoding='UTF-8'?>
<metadata>
<item>
<language>en</language>
<title>Nine Minute Ninja</title>
<network>CBBC</network>
<description>Art Ninja spinoff. Ricky makes art in nine minutes.</description>
<categories>
<category type="genre" name="Children"/>
</categories>
<studios>
<studio name="CBBC"/>
</studios>
<runtime>10</runtime>
<inetref>330432</inetref>
<ratingcount>0</ratingcount>
<year>2015</year>
<releasedate>2015-06-24</releasedate>
<lastupdated>...</lastupdated>
<status>Continuing</status>
<images>
<image type="coverart" url="http://www.thetvdb.com/banners/posters/330432-1.jpg" thumb="http://www.thetvdb.com/banners/_cache/posters/330432-1.jpg"/>
</images>
</item>
</metadata>
0
"""
from __future__ import print_function

Expand Down

0 comments on commit ed43561

Please sign in to comment.