Using UTF8 everywhere

pull/26/head
Louis Vézina 7 years ago
parent a197f70874
commit 637a9ba728

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
bazarr_version = '0.1.2' bazarr_version = '0.1.2'
from bottle import route, run, template, static_file, request, redirect from bottle import route, run, template, static_file, request, redirect
@ -408,7 +411,7 @@ def remove_subtitles():
except OSError: except OSError:
pass pass
store_subtitles(episodePath) store_subtitles(episodePath)
list_missing_subtitles(tvdbid) list_missing_subtitles(sonarrSeriesId)
@route(base_url + 'get_subtitle', method='POST') @route(base_url + 'get_subtitle', method='POST')
def get_subtitle(): def get_subtitle():
@ -436,7 +439,7 @@ def get_subtitle():
if result is not None: if result is not None:
history_log(1, sonarrSeriesId, sonarrEpisodeId, result) history_log(1, sonarrSeriesId, sonarrEpisodeId, result)
store_subtitles(episodePath) store_subtitles(episodePath)
list_missing_subtitles(tvdbid) list_missing_subtitles(sonarrSeriesId)
redirect(ref) redirect(ref)
except OSError: except OSError:
pass pass

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
from get_general_settings import * from get_general_settings import *
import os import os

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import os import os
import sqlite3 import sqlite3
import requests import requests

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import sqlite3 import sqlite3
import os import os
import ast import ast

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import sqlite3 import sqlite3
import pycountry import pycountry
import os import os

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import sqlite3 import sqlite3
import os import os
from subliminal import * from subliminal import *

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import os import os
import sqlite3 import sqlite3
import requests import requests

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import sqlite3 import sqlite3
import os import os
import ast import ast

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import os import os
import sqlite3 import sqlite3
import ast import ast
@ -29,7 +32,7 @@ def download_subtitle(path, language, hi, providers):
def series_download_subtitles(no): def series_download_subtitles(no):
conn_db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db')) conn_db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'))
c_db = conn_db.cursor() 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() 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() enabled_providers = c_db.execute("SELECT name FROM table_settings_providers WHERE enabled = 1").fetchall()
c_db.close() c_db.close()
@ -75,4 +78,4 @@ def wanted_search_missing_subtitles():
c.close() c.close()
for episode in data: for episode in data:
wanted_download_subtitles(episode[0]) wanted_download_subtitles(episode[0])

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import os import os
import sqlite3 import sqlite3

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import os import os
import enzyme import enzyme
import babelfish import babelfish
@ -68,7 +71,7 @@ def store_subtitles(file):
def list_missing_subtitles(*no): def list_missing_subtitles(*no):
query_string = '' query_string = ''
try: try:
query_string = " WHERE table_shows.tvdbId = " + str(no[0]) query_string = " WHERE table_shows.sonarrSeriesId = " + str(no[0])
except: except:
pass pass
conn_db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db')) conn_db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'))

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
from get_general_settings import * from get_general_settings import *
from get_series import * from get_series import *
from get_episodes import * from get_episodes import *

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
from get_general_settings import * from get_general_settings import *
import git import git

@ -1,3 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import os import os
import sqlite3 import sqlite3
import time import time

Loading…
Cancel
Save