[mythtv-commits] Ticket #12538: Recent change in tmdb3.py making it often fail on country specific requests

MythTV noreply at mythtv.org
Wed Nov 11 19:17:45 UTC 2015


#12538: Recent change in tmdb3.py making it often fail on country specific requests
-----------------------------------------+----------------------------
 Reporter:  hikavdh@…                    |          Owner:  dekarl
     Type:  Patch - Bug Fix              |         Status:  infoneeded
 Priority:  minor                        |      Milestone:
Component:  MythTV - Mythmetadatalookup  |        Version:  0.27.5
 Severity:  medium                       |     Resolution:
 Keywords:  tmdb3.py                     |  Ticket locked:  0
-----------------------------------------+----------------------------

Comment (by hikavdh@…):

 So sumarizing starting at line 66:
 {{{
 -    if opts.country:
 -        try:
 -            # resort releases with selected country at top to ensure it
 -            # is selected by the metadata libraries
 -            index = zip(*releases)[0].index(opts.country)
 -            releases.insert(0, releases.pop(index))
 -        except IndexError, ValueError:
 -            pass
 -        else:
 -            m.releasedate = releases[0][1].releasedate
 +    if len(releases) > 0:
 +        if opts.country:
 +            # resort releases with selected country at top to ensure it
 +            # is selected by the metadata libraries
 +            r = zip(*releases)
 +            if opts.country in r[0]:
 +                index = r[0].index(opts.country)
 +                releases.insert(0, releases.pop(index))
 +
 +        m.releasedate = releases[0][1].releasedate

     m.inetref = str(movie.id)
     if movie.collection:
         m.collectionref = str(movie.collection.id)
 -    if movie.releasedate:
 -        m.year = movie.releasedate.year
 +    if m.releasedate:
 +        m.year = m.releasedate.year
 }}}
 It might be I'm missing some things? Should year be the localized release
 year or the first release year. It's not all clear to me.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/12538#comment:8>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list