mirror of https://github.com/morpheus65535/bazarr
Filtering year from shows and movies already including year #386.
This commit is contained in:
parent
477bdbd9f3
commit
ab237c0ad8
|
@ -17,6 +17,7 @@ import warnings
|
||||||
import queueconfig
|
import queueconfig
|
||||||
import platform
|
import platform
|
||||||
import apprise
|
import apprise
|
||||||
|
import re
|
||||||
|
|
||||||
from get_args import args
|
from get_args import args
|
||||||
from init import *
|
from init import *
|
||||||
|
@ -606,13 +607,13 @@ def search_json(query):
|
||||||
('%' + query + '%',))
|
('%' + query + '%',))
|
||||||
series = c.fetchall()
|
series = c.fetchall()
|
||||||
for serie in series:
|
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'):
|
if settings.general.getboolean('use_radarr'):
|
||||||
c.execute("SELECT title, radarrId, year 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] + ' (' + 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()
|
c.close()
|
||||||
|
|
||||||
response.content_type = 'application/json'
|
response.content_type = 'application/json'
|
||||||
|
|
Loading…
Reference in New Issue