|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
bazarr_version = '0.3.0'
|
|
|
|
|
bazarr_version = '0.3.1'
|
|
|
|
|
|
|
|
|
|
from bottle import route, run, template, static_file, request, redirect, response
|
|
|
|
|
import bottle
|
|
|
|
@ -128,6 +128,7 @@ def image_proxy(url):
|
|
|
|
|
@route(base_url)
|
|
|
|
|
def series():
|
|
|
|
|
import update_db
|
|
|
|
|
single_language = get_general_settings()[7]
|
|
|
|
|
|
|
|
|
|
db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
|
db.create_function("path_substitution", 1, path_replace)
|
|
|
|
@ -147,11 +148,13 @@ def series():
|
|
|
|
|
c.execute("SELECT code2, name FROM table_settings_languages WHERE enabled = 1")
|
|
|
|
|
languages = c.fetchall()
|
|
|
|
|
c.close()
|
|
|
|
|
output = template('series', __file__=__file__, bazarr_version=bazarr_version, rows=data, languages=languages, missing_count=missing_count, page=page, max_page=max_page, base_url=base_url)
|
|
|
|
|
output = template('series', __file__=__file__, bazarr_version=bazarr_version, rows=data, languages=languages, missing_count=missing_count, page=page, max_page=max_page, base_url=base_url, single_language=single_language)
|
|
|
|
|
return output
|
|
|
|
|
|
|
|
|
|
@route(base_url + 'serieseditor')
|
|
|
|
|
def serieseditor():
|
|
|
|
|
single_language = get_general_settings()[7]
|
|
|
|
|
|
|
|
|
|
db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
|
db.create_function("path_substitution", 1, path_replace)
|
|
|
|
|
c = db.cursor()
|
|
|
|
@ -165,7 +168,7 @@ def serieseditor():
|
|
|
|
|
c.execute("SELECT code2, name FROM table_settings_languages WHERE enabled = 1")
|
|
|
|
|
languages = c.fetchall()
|
|
|
|
|
c.close()
|
|
|
|
|
output = template('serieseditor', __file__=__file__, bazarr_version=bazarr_version, rows=data, languages=languages, missing_count=missing_count, base_url=base_url)
|
|
|
|
|
output = template('serieseditor', __file__=__file__, bazarr_version=bazarr_version, rows=data, languages=languages, missing_count=missing_count, base_url=base_url, single_language=single_language)
|
|
|
|
|
return output
|
|
|
|
|
|
|
|
|
|
@route(base_url + 'series_json/<query>', method='GET')
|
|
|
|
@ -243,7 +246,7 @@ def edit_serieseditor():
|
|
|
|
|
|
|
|
|
|
@route(base_url + 'episodes/<no:int>', method='GET')
|
|
|
|
|
def episodes(no):
|
|
|
|
|
from get_sonarr_settings import get_sonarr_settings
|
|
|
|
|
single_language = get_general_settings()[7]
|
|
|
|
|
url_sonarr_short = get_sonarr_settings()[1]
|
|
|
|
|
|
|
|
|
|
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
@ -380,10 +383,15 @@ def save_settings():
|
|
|
|
|
settings_general_automatic = 'False'
|
|
|
|
|
else:
|
|
|
|
|
settings_general_automatic = 'True'
|
|
|
|
|
settings_general_single_language = request.forms.get('settings_general_single_language')
|
|
|
|
|
if settings_general_single_language is None:
|
|
|
|
|
settings_general_single_language = 'False'
|
|
|
|
|
else:
|
|
|
|
|
settings_general_single_language = 'True'
|
|
|
|
|
|
|
|
|
|
before = c.execute("SELECT ip, port, base_url FROM table_settings_general").fetchone()
|
|
|
|
|
after = (unicode(settings_general_ip), int(settings_general_port), unicode(settings_general_baseurl))
|
|
|
|
|
c.execute("UPDATE table_settings_general SET ip = ?, port = ?, base_url = ?, path_mapping = ?, log_level = ?, branch=?, auto_update=?", (unicode(settings_general_ip), int(settings_general_port), unicode(settings_general_baseurl), unicode(settings_general_pathmapping), unicode(settings_general_loglevel), unicode(settings_general_branch), unicode(settings_general_automatic)))
|
|
|
|
|
c.execute("UPDATE table_settings_general SET ip = ?, port = ?, base_url = ?, path_mapping = ?, log_level = ?, branch=?, auto_update=?, single_language=?", (unicode(settings_general_ip), int(settings_general_port), unicode(settings_general_baseurl), unicode(settings_general_pathmapping), unicode(settings_general_loglevel), unicode(settings_general_branch), unicode(settings_general_automatic), unicode(settings_general_single_language)))
|
|
|
|
|
conn.commit()
|
|
|
|
|
if after != before:
|
|
|
|
|
configured()
|
|
|
|
|