Fix Tmdb In caso non si conosca il mediatype e sia presente l'anno
This commit is contained in:
@@ -70,7 +70,7 @@ def peliculas(item):
|
|||||||
action = 'check'
|
action = 'check'
|
||||||
patron = r'src="(?P<poster>http[^"]+)(?:[^>]+>){4}\s*<a href="(?P<url>[^"]+)[^>]+>\s*(?P<title>[^\[\(\<]+)(?:\[(?P<quality>[^\]]+)\])?\s*(?:\((?P<lang>[a-zA-z-]+)\))?\s*(?:\((?P<year>\d+)\))?\s*</a>\s*</h2>'
|
patron = r'src="(?P<poster>http[^"]+)(?:[^>]+>){4}\s*<a href="(?P<url>[^"]+)[^>]+>\s*(?P<title>[^\[\(\<]+)(?:\[(?P<quality>[^\]]+)\])?\s*(?:\((?P<lang>[a-zA-z-]+)\))?\s*(?:\((?P<year>\d+)\))?\s*</a>\s*</h2>'
|
||||||
if item.args == 'search':
|
if item.args == 'search':
|
||||||
patron = '<title>(?P<title>[^\[\(\<]+)(?:\[(?P<quality>[^\]]+)\])?\s*(?:\((?P<lang>[a-zA-z-]+)\))?[^>]+>\s*<link>(?P<url>[^<]+)'
|
patron = r'<title>(?P<title>[^\[\(\<]+)(?:\[(?P<quality>[^\]]+)\])?\s*(?:\((?P<lang>[a-zA-z-]+)\))?\s*(?:\((?P<year>\d+)\))?\s*[^>]+>\s*<link>(?P<url>[^<]+)'
|
||||||
patronNext = r'href="([^"]+)[^>]+>Successivo'
|
patronNext = r'href="([^"]+)[^>]+>Successivo'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -1033,7 +1033,13 @@ class Tmdb(object):
|
|||||||
if len(results) > 1:
|
if len(results) > 1:
|
||||||
from lib.fuzzy_match import algorithims
|
from lib.fuzzy_match import algorithims
|
||||||
if self.search_type == 'multi':
|
if self.search_type == 'multi':
|
||||||
results.sort(key=lambda r: algorithims.trigram(text_simple, r.get('name', '') if r.get('media_type') == 'tv' else r.get('title', '')), reverse=True)
|
if self.search_year:
|
||||||
|
for r in results:
|
||||||
|
if (r.get('release_date', '') and r.get('release_date', '')[:4] == self.search_year) or (r.get('first_air_date', '') and r.get('first_air_date', '')[:4] == self.search_year):
|
||||||
|
results = [r]
|
||||||
|
break
|
||||||
|
if len(results) > 1:
|
||||||
|
results.sort(key=lambda r: algorithims.trigram(text_simple, r.get('name', '') if r.get('media_type') == 'tv' else r.get('title', '')), reverse=True)
|
||||||
else:
|
else:
|
||||||
results.sort(key=lambda r: algorithims.trigram(text_simple, r.get('name', '') if self.search_type == 'tv' else r.get('title', '')), reverse=True)
|
results.sort(key=lambda r: algorithims.trigram(text_simple, r.get('name', '') if self.search_type == 'tv' else r.get('title', '')), reverse=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user