1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-25 01:02:19 +00:00

Added year in search result #386.

This commit is contained in:
Louis Vézina 2019-04-10 13:28:20 -04:00
parent 9e6141d4f4
commit 477bdbd9f3

View file

@ -602,17 +602,17 @@ def search_json(query):
search_list = [] search_list = []
if settings.general.getboolean('use_sonarr'): 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 + '%',)) ('%' + query + '%',))
series = c.fetchall() series = c.fetchall()
for serie in series: 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'): 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() movies = c.fetchall()
for movie in movies: 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() c.close()
response.content_type = 'application/json' response.content_type = 'application/json'