From ab237c0ad8b1e1fd28beaf5baaada6122068b932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Wed, 10 Apr 2019 22:43:13 -0400 Subject: [PATCH] Filtering year from shows and movies already including year #386. --- bazarr/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bazarr/main.py b/bazarr/main.py index 326daf65b..e0690c08b 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -17,6 +17,7 @@ import warnings import queueconfig import platform import apprise +import re from get_args import args from init import * @@ -606,13 +607,13 @@ def search_json(query): ('%' + query + '%',)) series = c.fetchall() for serie in series: - search_list.append(dict([('name', serie[0] + ' (' + serie[2] + ')'), ('url', base_url + 'episodes/' + str(serie[1]))])) + search_list.append(dict([('name', re.sub(r'\ \(\d{4}\)', '', serie[0]) + ' (' + serie[2] + ')'), ('url', base_url + 'episodes/' + str(serie[1]))])) if settings.general.getboolean('use_radarr'): c.execute("SELECT title, radarrId, year FROM table_movies WHERE title LIKE ? ORDER BY title", ('%' + query + '%',)) movies = c.fetchall() for movie in movies: - search_list.append(dict([('name', movie[0] + ' (' + movie[2] + ')'), ('url', base_url + 'movie/' + str(movie[1]))])) + search_list.append(dict([('name', re.sub(r'\ \(\d{4}\)', '', movie[0]) + ' (' + movie[2] + ')'), ('url', base_url + 'movie/' + str(movie[1]))])) c.close() response.content_type = 'application/json'