From 6614b136abd83ad3d7e49122b1b72d0ec8f380bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Mon, 4 Nov 2019 06:34:33 -0500 Subject: [PATCH] Fix for Enzyme mkv object used before assignment. --- bazarr/embedded_subs_reader.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bazarr/embedded_subs_reader.py b/bazarr/embedded_subs_reader.py index 40fd7d914..9938a5f4a 100644 --- a/bazarr/embedded_subs_reader.py +++ b/bazarr/embedded_subs_reader.py @@ -34,8 +34,9 @@ class EmbeddedSubsReader: mkv = enzyme.MKV(f) except MalformedMKVError: logging.error('BAZARR cannot analyze this MKV with our built-in MKV parser, you should install ffmpeg: ' + file) - for subtitle_track in mkv.subtitle_tracks: - subtitles_list.append([subtitle_track.language, subtitle_track.forced, subtitle_track.codec_id]) + else: + for subtitle_track in mkv.subtitle_tracks: + subtitles_list.append([subtitle_track.language, subtitle_track.forced, subtitle_track.codec_id]) return subtitles_list