From 477bdbd9f3dd5bfcbc588796b982ad28ba66522b 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 13:28:20 -0400 Subject: [PATCH] Added year in search result #386. --- bazarr/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bazarr/main.py b/bazarr/main.py index 435627082..326daf65b 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -602,17 +602,17 @@ def search_json(query): search_list = [] if settings.general.getboolean('use_sonarr'): - c.execute("SELECT title, sonarrSeriesId FROM table_shows WHERE title LIKE ? ORDER BY title", + c.execute("SELECT title, sonarrSeriesId, year FROM table_shows WHERE title LIKE ? ORDER BY title", ('%' + query + '%',)) series = c.fetchall() for serie in series: - search_list.append(dict([('name', serie[0]), ('url', base_url + 'episodes/' + str(serie[1]))])) + search_list.append(dict([('name', serie[0] + ' (' + serie[2] + ')'), ('url', base_url + 'episodes/' + str(serie[1]))])) if settings.general.getboolean('use_radarr'): - c.execute("SELECT title, radarrId FROM table_movies WHERE title LIKE ? ORDER BY title", ('%' + query + '%',)) + 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]), ('url', base_url + 'movie/' + str(movie[1]))])) + search_list.append(dict([('name', movie[0] + ' (' + movie[2] + ')'), ('url', base_url + 'movie/' + str(movie[1]))])) c.close() response.content_type = 'application/json'