|
|
@ -7,7 +7,7 @@ import os
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
reload(sys)
|
|
|
|
reload(sys)
|
|
|
|
sys.setdefaultencoding('utf8')
|
|
|
|
sys.setdefaultencoding('utf8')
|
|
|
|
sys.path.insert(0,os.path.join(os.path.dirname(__file__), 'libs/'))
|
|
|
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'libs/'))
|
|
|
|
|
|
|
|
|
|
|
|
import sqlite3
|
|
|
|
import sqlite3
|
|
|
|
from init_db import *
|
|
|
|
from init_db import *
|
|
|
@ -61,7 +61,7 @@ from update_modules import *
|
|
|
|
|
|
|
|
|
|
|
|
from bottle import route, run, template, static_file, request, redirect, response, HTTPError
|
|
|
|
from bottle import route, run, template, static_file, request, redirect, response, HTTPError
|
|
|
|
import bottle
|
|
|
|
import bottle
|
|
|
|
bottle.TEMPLATE_PATH.insert(0,os.path.join(os.path.dirname(__file__), 'views/'))
|
|
|
|
bottle.TEMPLATE_PATH.insert(0, os.path.join(os.path.dirname(__file__), 'views/'))
|
|
|
|
bottle.debug(True)
|
|
|
|
bottle.debug(True)
|
|
|
|
bottle.TEMPLATES.clear()
|
|
|
|
bottle.TEMPLATES.clear()
|
|
|
|
|
|
|
|
|
|
|
@ -79,19 +79,19 @@ import math
|
|
|
|
import ast
|
|
|
|
import ast
|
|
|
|
import hashlib
|
|
|
|
import hashlib
|
|
|
|
|
|
|
|
|
|
|
|
from get_languages import *
|
|
|
|
from get_languages import load_language_in_db, language_from_alpha3
|
|
|
|
from get_providers import *
|
|
|
|
from get_providers import *
|
|
|
|
|
|
|
|
|
|
|
|
from get_series import *
|
|
|
|
from get_series import *
|
|
|
|
from get_episodes import *
|
|
|
|
from get_episodes import *
|
|
|
|
from get_general_settings import *
|
|
|
|
from get_general_settings import base_url, ip, port, path_replace, path_replace_movie
|
|
|
|
from get_sonarr_settings import *
|
|
|
|
from get_sonarr_settings import get_sonarr_settings
|
|
|
|
from check_update import *
|
|
|
|
from check_update import check_and_apply_update
|
|
|
|
from list_subtitles import *
|
|
|
|
from list_subtitles import store_subtitles, store_subtitles_movie, series_scan_subtitles, movies_scan_subtitles, list_missing_subtitles, list_missing_subtitles_movies
|
|
|
|
from get_subtitle import *
|
|
|
|
from get_subtitle import download_subtitle, series_download_subtitles, movies_download_subtitles, wanted_download_subtitles, wanted_search_missing_subtitles
|
|
|
|
from utils import *
|
|
|
|
from utils import history_log, history_log_movie
|
|
|
|
from scheduler import *
|
|
|
|
from scheduler import *
|
|
|
|
from notifier import send_notifications
|
|
|
|
from notifier import send_notifications, send_notifications_movie
|
|
|
|
|
|
|
|
|
|
|
|
# Reset restart required warning on start
|
|
|
|
# Reset restart required warning on start
|
|
|
|
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
@ -216,7 +216,6 @@ def redirect_root():
|
|
|
|
@route(base_url + 'series')
|
|
|
|
@route(base_url + 'series')
|
|
|
|
@custom_auth_basic(check_credentials)
|
|
|
|
@custom_auth_basic(check_credentials)
|
|
|
|
def series():
|
|
|
|
def series():
|
|
|
|
import update_db
|
|
|
|
|
|
|
|
single_language = get_general_settings()[7]
|
|
|
|
single_language = get_general_settings()[7]
|
|
|
|
|
|
|
|
|
|
|
|
db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
@ -361,7 +360,7 @@ def edit_serieseditor():
|
|
|
|
@route(base_url + 'episodes/<no:int>', method='GET')
|
|
|
|
@route(base_url + 'episodes/<no:int>', method='GET')
|
|
|
|
@custom_auth_basic(check_credentials)
|
|
|
|
@custom_auth_basic(check_credentials)
|
|
|
|
def episodes(no):
|
|
|
|
def episodes(no):
|
|
|
|
single_language = get_general_settings()[7]
|
|
|
|
# single_language = get_general_settings()[7]
|
|
|
|
url_sonarr_short = get_sonarr_settings()[1]
|
|
|
|
url_sonarr_short = get_sonarr_settings()[1]
|
|
|
|
|
|
|
|
|
|
|
|
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
@ -378,7 +377,7 @@ def episodes(no):
|
|
|
|
c.close()
|
|
|
|
c.close()
|
|
|
|
episodes = reversed(sorted(episodes, key=operator.itemgetter(2)))
|
|
|
|
episodes = reversed(sorted(episodes, key=operator.itemgetter(2)))
|
|
|
|
seasons_list = []
|
|
|
|
seasons_list = []
|
|
|
|
for key,season in itertools.groupby(episodes,operator.itemgetter(2)):
|
|
|
|
for key, season in itertools.groupby(episodes,operator.itemgetter(2)):
|
|
|
|
seasons_list.append(list(season))
|
|
|
|
seasons_list.append(list(season))
|
|
|
|
|
|
|
|
|
|
|
|
return template('episodes', __file__=__file__, bazarr_version=bazarr_version, no=no, details=series_details, languages=languages, seasons=seasons_list, url_sonarr_short=url_sonarr_short, base_url=base_url, tvdbid=tvdbid, number=number)
|
|
|
|
return template('episodes', __file__=__file__, bazarr_version=bazarr_version, no=no, details=series_details, languages=languages, seasons=seasons_list, url_sonarr_short=url_sonarr_short, base_url=base_url, tvdbid=tvdbid, number=number)
|
|
|
@ -386,7 +385,6 @@ def episodes(no):
|
|
|
|
@route(base_url + 'movies')
|
|
|
|
@route(base_url + 'movies')
|
|
|
|
@custom_auth_basic(check_credentials)
|
|
|
|
@custom_auth_basic(check_credentials)
|
|
|
|
def movies():
|
|
|
|
def movies():
|
|
|
|
import update_db
|
|
|
|
|
|
|
|
single_language = get_general_settings()[7]
|
|
|
|
single_language = get_general_settings()[7]
|
|
|
|
|
|
|
|
|
|
|
|
db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
@ -498,7 +496,7 @@ def edit_movie(no):
|
|
|
|
@custom_auth_basic(check_credentials)
|
|
|
|
@custom_auth_basic(check_credentials)
|
|
|
|
def movie(no):
|
|
|
|
def movie(no):
|
|
|
|
from get_radarr_settings import get_radarr_settings
|
|
|
|
from get_radarr_settings import get_radarr_settings
|
|
|
|
single_language = get_general_settings()[7]
|
|
|
|
# single_language = get_general_settings()[7]
|
|
|
|
url_radarr_short = get_radarr_settings()[1]
|
|
|
|
url_radarr_short = get_radarr_settings()[1]
|
|
|
|
|
|
|
|
|
|
|
|
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
@ -1280,7 +1278,7 @@ def get_subtitle():
|
|
|
|
hi = request.forms.get('hi')
|
|
|
|
hi = request.forms.get('hi')
|
|
|
|
sonarrSeriesId = request.forms.get('sonarrSeriesId')
|
|
|
|
sonarrSeriesId = request.forms.get('sonarrSeriesId')
|
|
|
|
sonarrEpisodeId = request.forms.get('sonarrEpisodeId')
|
|
|
|
sonarrEpisodeId = request.forms.get('sonarrEpisodeId')
|
|
|
|
tvdbid = request.forms.get('tvdbid')
|
|
|
|
# tvdbid = request.forms.get('tvdbid')
|
|
|
|
|
|
|
|
|
|
|
|
db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
c = db.cursor()
|
|
|
|
c = db.cursor()
|
|
|
@ -1326,7 +1324,7 @@ def get_subtitle_movie():
|
|
|
|
language = request.forms.get('language')
|
|
|
|
language = request.forms.get('language')
|
|
|
|
hi = request.forms.get('hi')
|
|
|
|
hi = request.forms.get('hi')
|
|
|
|
radarrId = request.forms.get('radarrId')
|
|
|
|
radarrId = request.forms.get('radarrId')
|
|
|
|
tmdbid = request.forms.get('tmdbid')
|
|
|
|
# tmdbid = request.forms.get('tmdbid')
|
|
|
|
|
|
|
|
|
|
|
|
db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
c = db.cursor()
|
|
|
|
c = db.cursor()
|
|
|
|