diff options
author | Britney Fransen <brfransen@gmail.com> | 2019-03-19 20:11:10 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2019-03-19 20:11:10 (GMT) |
commit | 73cfb83a5baecfe0529fda59ca57233d8843f783 (patch) | |
tree | 2dba2103a6f6e43912fc645ca8b48a85ab500ad2 /abs/core/mythtv/stable-30/mythtv/pull103-Add-heuristic-in-TMDB-script-to-detect-movie-release-years.patch | |
parent | 7b41a9288f5d1332c8136df798bb8ca2465bc21c (diff) | |
parent | 448cb8d0708224d78c24ce3615dc7eef44d4689b (diff) | |
download | linhes_pkgbuild-73cfb83a5baecfe0529fda59ca57233d8843f783.zip linhes_pkgbuild-73cfb83a5baecfe0529fda59ca57233d8843f783.tar.gz linhes_pkgbuild-73cfb83a5baecfe0529fda59ca57233d8843f783.tar.bz2 |
Merge branch 'testing'
Diffstat (limited to 'abs/core/mythtv/stable-30/mythtv/pull103-Add-heuristic-in-TMDB-script-to-detect-movie-release-years.patch')
-rw-r--r-- | abs/core/mythtv/stable-30/mythtv/pull103-Add-heuristic-in-TMDB-script-to-detect-movie-release-years.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/abs/core/mythtv/stable-30/mythtv/pull103-Add-heuristic-in-TMDB-script-to-detect-movie-release-years.patch b/abs/core/mythtv/stable-30/mythtv/pull103-Add-heuristic-in-TMDB-script-to-detect-movie-release-years.patch new file mode 100644 index 0000000..2845250 --- /dev/null +++ b/abs/core/mythtv/stable-30/mythtv/pull103-Add-heuristic-in-TMDB-script-to-detect-movie-release-years.patch @@ -0,0 +1,39 @@ +--- src/mythtv/programs/scripts/metadata/Movie/tmdb3.py 2017-02-23 13:18:12.000000000 +0100 ++++ src/mythtv/programs/scripts/metadata/Movie/tmdb3.py 2017-02-25 13:12:40.213333328 +0100 +@@ -29,6 +29,7 @@ + + from optparse import OptionParser + import sys ++import re + + def buildSingle(inetref, opts): + from MythTV.tmdb3.tmdb_exceptions import TMDBRequestInvalid +@@ -122,11 +123,27 @@ + # replace all dashes from queries to work around search behavior + # as negative to all text that comes afterwards + query = query.replace('-',' ') ++ query = query.strip() # trim extra whitespace ++ # extract year from name -- note that we require a space before the year ++ # so we don't confuse movie names for years (example: "2012 - 2009", ++ # a 2009 movie); also note that we accept optional paranthesis around ++ # the year: ++ yearRegex = re.compile(r"\s\(?((19|20)[0-9]{2})\)?$") ++ year = yearRegex.search(query) ++ if year is not None: ++ year = year.group(1) ++ # if no year was found, we'll pass year=None to searchMovie, ++ # which is the default anyway ++ ++ # get rid of the year (if any) from the query text, because ++ # it causes bad TMDB results ++ query = yearRegex.sub("", query) ++ query = query.strip() + + from MythTV.tmdb3 import searchMovie + from MythTV import VideoMetadata + from lxml import etree +- results = iter(searchMovie(query)) ++ results = iter(searchMovie(query, locale=None, adult=False, year=year)) + tree = etree.XML(u'<metadata></metadata>') + mapping = [['runtime', 'runtime'], ['title', 'originaltitle'], + ['releasedate', 'releasedate'], ['tagline', 'tagline'], |