diff --git a/bazarr.py b/bazarr.py index c83f801e0..d8415ee12 100644 --- a/bazarr.py +++ b/bazarr.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + bazarr_version = '0.1.2' from bottle import route, run, template, static_file, request, redirect @@ -408,7 +411,7 @@ def remove_subtitles(): except OSError: pass store_subtitles(episodePath) - list_missing_subtitles(tvdbid) + list_missing_subtitles(sonarrSeriesId) @route(base_url + 'get_subtitle', method='POST') def get_subtitle(): @@ -436,7 +439,7 @@ def get_subtitle(): if result is not None: history_log(1, sonarrSeriesId, sonarrEpisodeId, result) store_subtitles(episodePath) - list_missing_subtitles(tvdbid) + list_missing_subtitles(sonarrSeriesId) redirect(ref) except OSError: pass diff --git a/check_update.py b/check_update.py index f4ecc2e33..def41fe11 100644 --- a/check_update.py +++ b/check_update.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + from get_general_settings import * import os diff --git a/get_episodes.py b/get_episodes.py index f8ad5ab34..ee9f5750e 100644 --- a/get_episodes.py +++ b/get_episodes.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + import os import sqlite3 import requests diff --git a/get_general_settings.py b/get_general_settings.py index b86698fe8..cbe6d6aef 100644 --- a/get_general_settings.py +++ b/get_general_settings.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + import sqlite3 import os import ast diff --git a/get_languages.py b/get_languages.py index efb7cc4b0..8a81cb1cf 100644 --- a/get_languages.py +++ b/get_languages.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + import sqlite3 import pycountry import os diff --git a/get_providers.py b/get_providers.py index c02e5c126..cfdf109ed 100644 --- a/get_providers.py +++ b/get_providers.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + import sqlite3 import os from subliminal import * diff --git a/get_series.py b/get_series.py index 07c52f924..61f89d080 100644 --- a/get_series.py +++ b/get_series.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + import os import sqlite3 import requests diff --git a/get_sonarr_settings.py b/get_sonarr_settings.py index bf64883b4..93a02f1cc 100644 --- a/get_sonarr_settings.py +++ b/get_sonarr_settings.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + import sqlite3 import os import ast diff --git a/get_subtitle.py b/get_subtitle.py index f5f9015c5..f1e72c88e 100644 --- a/get_subtitle.py +++ b/get_subtitle.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + import os import sqlite3 import ast @@ -29,7 +32,7 @@ def download_subtitle(path, language, hi, providers): def series_download_subtitles(no): conn_db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db')) c_db = conn_db.cursor() - episodes_details = c_db.execute("SELECT path, missing_subtitles, sonarrEpisodeId FROM table_episodes WHERE path = ?", (no,)).fetchall() + episodes_details = c_db.execute("SELECT path, missing_subtitles, sonarrEpisodeId FROM table_episodes WHERE sonarrSeriesId = ?", (no,)).fetchall() series_details = c_db.execute("SELECT hearing_impaired FROM table_shows WHERE sonarrSeriesId = ?", (no,)).fetchone() enabled_providers = c_db.execute("SELECT name FROM table_settings_providers WHERE enabled = 1").fetchall() c_db.close() @@ -75,4 +78,4 @@ def wanted_search_missing_subtitles(): c.close() for episode in data: - wanted_download_subtitles(episode[0]) \ No newline at end of file + wanted_download_subtitles(episode[0]) diff --git a/init_db.py b/init_db.py index 1b6393284..9db99101b 100644 --- a/init_db.py +++ b/init_db.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + import os import sqlite3 diff --git a/list_subtitles.py b/list_subtitles.py index a5cd58ada..5d52861bb 100644 --- a/list_subtitles.py +++ b/list_subtitles.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + import os import enzyme import babelfish @@ -68,7 +71,7 @@ def store_subtitles(file): def list_missing_subtitles(*no): query_string = '' try: - query_string = " WHERE table_shows.tvdbId = " + str(no[0]) + query_string = " WHERE table_shows.sonarrSeriesId = " + str(no[0]) except: pass conn_db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db')) diff --git a/scheduler.py b/scheduler.py index a77e9efac..724b9a12b 100644 --- a/scheduler.py +++ b/scheduler.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + from get_general_settings import * from get_series import * from get_episodes import * diff --git a/update.py b/update.py index 69f249bf9..02b31f232 100644 --- a/update.py +++ b/update.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + from get_general_settings import * import git diff --git a/utils.py b/utils.py index 68adf89ad..8cc932785 100644 --- a/utils.py +++ b/utils.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + import os import sqlite3 import time