Merge pull request #3048 from pypeclub/bugfix/webpublisher_workfile_ffprobe_issue

Webpublisher: fix processing of workfile
This commit is contained in:
Petr Kalis 2022-04-11 12:06:32 +02:00 committed by GitHub
commit d2494ce6e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -108,15 +108,18 @@ class CollectPublishedFiles(pyblish.api.ContextPlugin):
instance.data["representations"] = self._get_single_repre(
task_dir, task_data["files"], tags
)
file_url = os.path.join(task_dir, task_data["files"][0])
no_of_frames = self._get_number_of_frames(file_url)
if no_of_frames:
if family != 'workfile':
file_url = os.path.join(task_dir, task_data["files"][0])
try:
frame_end = int(frame_start) + math.ceil(no_of_frames)
instance.data["frameEnd"] = math.ceil(frame_end) - 1
self.log.debug("frameEnd:: {}".format(
instance.data["frameEnd"]))
except ValueError:
no_of_frames = self._get_number_of_frames(file_url)
if no_of_frames:
frame_end = int(frame_start) + \
math.ceil(no_of_frames)
frame_end = math.ceil(frame_end) - 1
instance.data["frameEnd"] = frame_end
self.log.debug("frameEnd:: {}".format(
instance.data["frameEnd"]))
except Exception:
self.log.warning("Unable to count frames "
"duration {}".format(no_of_frames))