Fix for mediainfo error on Linux.

pull/551/head
Louis Vézina 5 years ago
parent d7c824500a
commit 3a1285e2da

@ -12,6 +12,7 @@ import codecs
import types import types
import re import re
import subliminal import subliminal
import platform
from datetime import datetime, timedelta from datetime import datetime, timedelta
from subzero.language import Language from subzero.language import Language
from subzero.video import parse_video from subzero.video import parse_video
@ -65,7 +66,7 @@ def get_video(path, title, sceneName, use_scenename, use_mediainfo, providers=No
video.original_path = original_path video.original_path = original_path
refine_from_db(original_path, video) refine_from_db(original_path, video)
if use_mediainfo: if platform.system() != "Linux" and use_mediainfo:
refine_from_mediainfo(original_path, video) refine_from_mediainfo(original_path, video)
logging.debug('BAZARR is using those video object properties: %s', vars(video)) logging.debug('BAZARR is using those video object properties: %s', vars(video))

@ -53,9 +53,10 @@ def get_binary(name):
binaries_dir = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', 'bin')) binaries_dir = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', 'bin'))
exe = None exe = None
installed_exe = which(name) if name != 'mediainfo':
installed_exe = which(name)
if installed_exe and os.path.isfile(installed_exe): if name != 'mediainfo' and installed_exe and os.path.isfile(installed_exe):
return installed_exe return installed_exe
else: else:
if platform.system() == "Windows": # Windows if platform.system() == "Windows": # Windows

@ -25,7 +25,8 @@
<label>Use MediaInfo</label> <label>Use MediaInfo</label>
</div> </div>
<div class="one wide column"> <div class="one wide column">
<div id="settings_mediainfo" class="ui toggle checkbox" data-mediainfo={{settings.general.getboolean('use_mediainfo')}}> % import platform
<div id="settings_mediainfo" class="ui toggle checkbox{{' disabled' if platform.system() == 'Linux' else ''}}" data-mediainfo={{settings.general.getboolean('use_mediainfo')}}>
<input name="settings_general_mediainfo" type="checkbox"> <input name="settings_general_mediainfo" type="checkbox">
<label></label> <label></label>
</div> </div>
@ -39,7 +40,7 @@
</div> </div>
<div class="collapsed column"> <div class="collapsed column">
<div class="collapsed center aligned column"> <div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="To use this feature on linux, please install mediainfo and its dependencies." data-inverted=""> <div class="ui basic icon" data-tooltip="This settings is only available on Windows and MacOS." data-inverted="">
<i class="yellow warning sign icon"></i> <i class="yellow warning sign icon"></i>
</div> </div>
</div> </div>

Loading…
Cancel
Save