fix(global): two types on repre["files"] support and better exception

oiio_supported didn't test path existence
This commit is contained in:
Jakub Jezek 2020-12-09 10:07:18 +01:00
parent 52feeabb44
commit b74dc3a7a7
No known key found for this signature in database
GPG key ID: C4B96E101D2A47F3
2 changed files with 14 additions and 4 deletions

View file

@ -145,7 +145,11 @@ def oiio_supported():
'should_decompress' will throw exception if configured,
but not present or working.
"""
return os.getenv("PYPE_OIIO_PATH", "") != ""
oiio_path = os.getenv("PYPE_OIIO_PATH", "")
if not os.path.exists(oiio_path) or not oiio_path:
raise IOError("Files do not exists in `{}`".format(oiio_path))
return True
def decompress(target_dir, file_url,

View file

@ -335,9 +335,15 @@ class ExtractReview(pyblish.api.InstancePlugin):
ffmpeg_video_filters = out_def_ffmpeg_args.get("video_filters") or []
ffmpeg_audio_filters = out_def_ffmpeg_args.get("audio_filters") or []
input_files_urls = [os.path.join(new_repre["stagingDir"], f) for f
in new_repre['files']]
do_decompress = should_decompress(input_files_urls[0])
if isinstance(new_repre['files'], list):
input_files_urls = [os.path.join(new_repre["stagingDir"], f) for f
in new_repre['files']]
do_decompress = should_decompress(input_files_urls[0])
else:
test_path = os.path.join(
new_repre["stagingDir"], new_repre['files'])
do_decompress = should_decompress(test_path)
if do_decompress:
# change stagingDir, decompress first
# calculate all paths with modified directory, used on too many