From 7e5527b4207438134b6eeb97cce6d37615982c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sat, 28 Sep 2019 14:05:34 -0400 Subject: [PATCH] Bug correction --- bazarr/get_series.py | 4 ++-- bazarr/get_subtitle.py | 4 ++-- libs/pyprobe/pyprobe.py | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bazarr/get_series.py b/bazarr/get_series.py index 4d3dd65c8..2a447ef69 100644 --- a/bazarr/get_series.py +++ b/bazarr/get_series.py @@ -165,9 +165,9 @@ def update_series(): removed_series = list(set(current_shows_db_list) - set(current_shows_sonarr)) for series in removed_series: - print(TableShows.delete().where( + TableShows.delete().where( TableShows.tvdb_id == series - ).execute()) + ).execute() logging.debug('BAZARR All series synced from Sonarr into database.') diff --git a/bazarr/get_subtitle.py b/bazarr/get_subtitle.py index c10450453..0eb2303d5 100644 --- a/bazarr/get_subtitle.py +++ b/bazarr/get_subtitle.py @@ -202,7 +202,7 @@ def download_subtitle(path, language, hi, forced, providers, providers_auth, sce directory=fld, chmod=chmod, # formats=("srt", "vtt") - path_decoder=None + path_decoder=force_unicode ) except Exception as e: logging.exception('BAZARR Error saving Subtitles file to disk for this file:' + path) @@ -429,7 +429,7 @@ def manual_download_subtitle(path, language, hi, forced, subtitle, provider, pro directory=fld, chmod=chmod, # formats=("srt", "vtt") - path_decoder=None) + path_decoder=force_unicode) except Exception as e: logging.exception('BAZARR Error saving Subtitles file to disk for this file:' + path) diff --git a/libs/pyprobe/pyprobe.py b/libs/pyprobe/pyprobe.py index 417961be2..b300965d5 100644 --- a/libs/pyprobe/pyprobe.py +++ b/libs/pyprobe/pyprobe.py @@ -176,8 +176,8 @@ class VideoFileParser: IOError: ffprobe execution failed """ - command = [parser] + commandArgs + [inputFile.encode(getfilesystemencoding())] if PY3: + command = [parser] + commandArgs + [inputFile] completedProcess = subprocess.run( command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8" ) @@ -187,6 +187,7 @@ class VideoFileParser: ) return completedProcess.stdout else: + command = [parser] + commandArgs + [inputFile.encode(getfilesystemencoding())] try: completedProcess = subprocess.check_output( command, stderr=subprocess.STDOUT