diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..0d20b6487 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/bazarr.py b/bazarr.py index cbffdca0b..e666e5037 100644 --- a/bazarr.py +++ b/bazarr.py @@ -3,10 +3,6 @@ import bottle bottle.debug(True) bottle.TEMPLATES.clear() -application = bottle.default_app() - -from paste import httpserver - import sqlite3 import itertools import operator @@ -28,6 +24,7 @@ def static(path): @route('/image_proxy/', method='GET') def image_proxy(url): + print url_sonarr_short + url img_pil = Image.open(BytesIO(requests.get(url_sonarr_short + '/' + url).content)) img_buffer = BytesIO() img_pil.tobytes() @@ -141,4 +138,17 @@ def remove_subtitles(): except OSError: redirect('/episodes/' + sonarrSeriesId + '?error=1') -httpserver.serve(application, host=ip, port=port) +@route('/remove_subtitles', method='GET') +def remove_subtitles(): + episodePath = request.GET.episodePath + subtitlesPath = request.GET.subtitlesPath + sonarrSeriesId = request.GET.sonarrSeriesId + + try: + os.remove(subtitlesPath) + store_subtitles(episodePath) + redirect('/episodes/' + sonarrSeriesId) + except OSError: + redirect('/episodes/' + sonarrSeriesId + '?error=1') + +run(host=ip, port=port) diff --git a/get_general_settings.pyc b/get_general_settings.pyc index ad1bef5a3..af3401c42 100644 Binary files a/get_general_settings.pyc and b/get_general_settings.pyc differ diff --git a/get_languages.pyc b/get_languages.pyc index 5b23d3f87..396da377d 100644 Binary files a/get_languages.pyc and b/get_languages.pyc differ diff --git a/get_sonarr_settings.pyc b/get_sonarr_settings.pyc index e7fcef83a..3dc844f3d 100644 Binary files a/get_sonarr_settings.pyc and b/get_sonarr_settings.pyc differ diff --git a/init_db.pyc b/init_db.pyc index cf1ce3fb4..488ba4aad 100644 Binary files a/init_db.pyc and b/init_db.pyc differ diff --git a/list_subtitles.pyc b/list_subtitles.pyc index e536f6d24..b82a1a6ff 100644 Binary files a/list_subtitles.pyc and b/list_subtitles.pyc differ diff --git a/views/episodes.tpl b/views/episodes.tpl index 9244f4752..600abfb4c 100644 --- a/views/episodes.tpl +++ b/views/episodes.tpl @@ -19,7 +19,7 @@