feat(nks): PR comments

This commit is contained in:
Jakub Jezek 2020-05-12 17:22:05 +02:00
parent 7d689cfe25
commit 8f3f3a4d92
No known key found for this signature in database
GPG key ID: C4B96E101D2A47F3
3 changed files with 25 additions and 15 deletions

View file

@ -55,7 +55,8 @@ class CollectClips(api.ContextPlugin):
is_sequence = False
self.log.debug(
"__ assets_shared: {}".format(context.data["assetsShared"]))
"__ assets_shared: {}".format(
context.data["assetsShared"]))
match_range = next(
(k for k, v in context.data["assetsShared"].items()
if (v.get("_clipIn", 0) == clip_in)

View file

@ -36,9 +36,10 @@ class CollectReviews(api.InstancePlugin):
return
if not track:
self.log.debug(
"Skipping \"{}\" because tag is not having `track` in metadata".format(instance)
)
self.log.debug((
"Skipping \"{}\" because tag is not having"
"`track` in metadata"
).format(instance))
return
# add to representations
@ -68,10 +69,11 @@ class CollectReviews(api.InstancePlugin):
rev_inst.data["name"]))
if rev_inst is None:
raise RuntimeError(
"TrackItem from track name `{}` has to be also selected".format(
track)
)
raise RuntimeError((
"TrackItem from track name `{}` has to"
"be also selected"
).format(track))
instance.data["families"].append("review")
file_path = rev_inst.data.get("sourcePath")
@ -140,15 +142,18 @@ class CollectReviews(api.InstancePlugin):
thumb_path = os.path.join(staging_dir, thumb_file)
self.log.debug("__ thumb_path: {}".format(thumb_path))
thumb_frame = instance.data["sourceIn"] + ((instance.data["sourceOut"] - instance.data["sourceIn"])/2)
thumb_frame = instance.data["sourceIn"] + (
(instance.data["sourceOut"] - instance.data["sourceIn"]) / 2)
self.log.debug("__ thumb_frame: {}".format(thumb_frame))
thumbnail = item.thumbnail(thumb_frame).save(
thumb_path,
format='png'
)
self.log.debug("__ sourceIn: `{}`".format(instance.data["sourceIn"]))
self.log.debug("__ thumbnail: `{}`, frame: `{}`".format(thumbnail, thumb_frame))
self.log.debug(
"__ sourceIn: `{}`".format(instance.data["sourceIn"]))
self.log.debug(
"__ thumbnail: `{}`, frame: `{}`".format(thumbnail, thumb_frame))
self.log.debug("__ thumbnail: {}".format(thumbnail))
@ -177,7 +182,7 @@ class CollectReviews(api.InstancePlugin):
version_data.update({k: instance.data[k] for k in transfer_data})
if 'version' in instance.data:
version_data["version"] = instance.data[version]
version_data["version"] = instance.data["version"]
# add to data of representation
version_data.update({

View file

@ -40,9 +40,13 @@ class ExtractReviewCutUpVideo(pype.api.Extractor):
tags = repre.get("tags", [])
if not next(
(t for t in tags
if t in ["_cut-bigger", "_cut-smaller"]), None):
# check if supported tags are in representation for activation
filter_tag = False
for tag in ["_cut-bigger", "_cut-smaller"]:
if tag in tags:
filter_tag = True
break
if not filter_tag:
continue
self.log.debug("__ repre: {}".format(repre))