Skip to content

Commit

Permalink
Use translated title rather than original title for results, if avail…
Browse files Browse the repository at this point in the history
…able.
  • Loading branch information
wagnerrp committed Nov 5, 2012
1 parent 9c95f5a commit e13600c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions mythtv/programs/scripts/metadata/Movie/tmdb3.py
Expand Up @@ -11,13 +11,14 @@
#-----------------------
__title__ = "TheMovieDB.org V3"
__author__ = "Raymond Wagner"
__version__ = "0.3.2"
__version__ = "0.3.3"
# 0.1.0 Initial version
# 0.2.0 Add language support, move cache to home directory
# 0.3.0 Enable version detection to allow use in MythTV
# 0.3.1 Add --test parameter for proper compatibility with mythmetadatalookup
# 0.3.2 Add --area parameter to allow country selection for release date and
# parental ratings
# 0.3.3 Use translated title if available

from optparse import OptionParser
import sys
Expand All @@ -38,13 +39,12 @@ def buildSingle(inetref, opts):
if getattr(movie, j):
setattr(m, i, getattr(movie, j))

if movie.title:
m.title = movie.title

releases = movie.releases.items()

if opts.country:
for alt in movie.alternate_titles:
if alt.country == opts.country:
m.title = alt.title
break
try:
# resort releases with selected country at top to ensure it
# is selected by the metadata libraries
Expand Down Expand Up @@ -113,6 +113,10 @@ def buildList(query, opts):
if getattr(res, j):
setattr(m, i, getattr(res, j))
m.inetref = str(res.id)

if res.title:
m.title = res.title

#TODO:
# should releasedate and year be pulled from the country-specific data
# or should it be left to the default information to cut down on
Expand Down

0 comments on commit e13600c

Please sign in to comment.