mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
OP-4470 - safer handling of review path
'published_path' might be missing. Thumbnail path was fixed previously, this one was missed.
This commit is contained in:
parent
c16a5289e4
commit
3a41d6a721
1 changed files with 8 additions and 4 deletions
|
|
@ -163,17 +163,21 @@ class IntegrateSlackAPI(pyblish.api.InstancePlugin):
|
|||
|
||||
def _get_review_path(self, instance):
|
||||
"""Returns abs url for review if present in instance repres"""
|
||||
published_path = None
|
||||
review_path = None
|
||||
for repre in instance.data.get("representations", []):
|
||||
tags = repre.get('tags', [])
|
||||
if (repre.get("review")
|
||||
or "review" in tags
|
||||
or "burnin" in tags):
|
||||
if os.path.exists(repre["published_path"]):
|
||||
published_path = repre["published_path"]
|
||||
repre_review_path = (
|
||||
repre.get("published_path") or
|
||||
os.path.join(repre["stagingDir"], repre["files"])
|
||||
)
|
||||
if os.path.exists(repre_review_path):
|
||||
review_path = repre_review_path
|
||||
if "burnin" in tags: # burnin has precedence if exists
|
||||
break
|
||||
return published_path
|
||||
return review_path
|
||||
|
||||
def _python2_call(self, token, channel, message, publish_files):
|
||||
from slackclient import SlackClient
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue