From 81a9787d066f308ec2cfceb0b9beeb0a0fe796c4 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sun, 7 Feb 2021 13:01:53 +0100 Subject: [PATCH] miglioria match tmdb su cinemalibero --- channels/cinemalibero.py | 2 ++ core/tmdb.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/channels/cinemalibero.py b/channels/cinemalibero.py index 151f5d23..30a54d34 100644 --- a/channels/cinemalibero.py +++ b/channels/cinemalibero.py @@ -77,6 +77,8 @@ def peliculas(item): item.title += support.typo(item.lang2, '_ [] color kod') if item.args == 'update': item.title = item.title.replace('-', ' ') + if item.args == 'search': + item.contentType = 'tvshow' if 'serie-' in item.url else 'movie' return item diff --git a/core/tmdb.py b/core/tmdb.py index d79e756e..0d863929 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -1021,7 +1021,7 @@ class Tmdb(object): # We sort result based on fuzzy match to detect most similar if len(results) > 1: from lib.fuzzy_match import algorithims - results.sort(key=lambda r: algorithims.trigram(text_simple, r['title']), reverse=True) + results.sort(key=lambda r: algorithims.trigram(text_simple, r['title'] if self.busqueda_tipo == 'movie' else r['name']), reverse=True) # We return the number of results of this page self.results = results