[mythtv-commits] Ticket #12538: Recent change in tmdb3.py making it often fail on country specific requests
MythTV
noreply at mythtv.org
Mon Nov 9 21:49:12 UTC 2015
#12538: Recent change in tmdb3.py making it often fail on country specific requests
---------------------------------------------+-----------------------
Reporter: hikavdh@… | Owner: jyavenard
Type: Bug Report - Crash | Status: new
Priority: minor | Milestone: 0.27.6
Component: MythTV - Mythmetadatalookup | Version: 0.27.5
Severity: medium | Keywords: tmdb3.py
Ticket locked: 0 |
---------------------------------------------+-----------------------
While the old code handled a missing country specific release date, the
addition of an extra error handler makes it fail.
Line 66 to 75:
{{{
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:
+ # 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
}}}
either this or removing again the `IndexError` or reverting the order of
the two error handlers. But I think this nicer!
Hika
--
Ticket URL: <https://code.mythtv.org/trac/ticket/12538>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list