From d37eac4a226444fa5b49798f6e8b39d8b6303219 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 12 Aug 2020 13:51:28 +0200 Subject: [PATCH] Modified 'sites' element to object of objects for better syncing --- pype/plugins/global/publish/integrate_new.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pype/plugins/global/publish/integrate_new.py b/pype/plugins/global/publish/integrate_new.py index 2cf09474b8..fb1588f7d8 100644 --- a/pype/plugins/global/publish/integrate_new.py +++ b/pype/plugins/global/publish/integrate_new.py @@ -12,6 +12,7 @@ import pyblish.api from avalon import io from avalon.vendor import filelink import pype.api +from datetime import datetime # this is needed until speedcopy for linux is fixed if sys.platform == "win32": @@ -902,13 +903,13 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): path: destination url of published file (rootless) size(optional): size of file in bytes file_hash(optional): hash of file for synchronization validation - sites(optional): array of published locations, ['studio'] by default - expected ['studio', 'site1', 'gdrive1'] + sites(optional): array of published locations, ['studio': {'created_dt':date}] by default + keys expected ['studio', 'site1', 'gdrive1'] Returns: rec: dictionary with filled info """ - rec = { # TODO update collection step to extend with necessary values + rec = { "_id": io.ObjectId(), "path": path } @@ -921,7 +922,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): if sites: rec["sites"] = sites else: - rec["sites"] = ["studio"] + meta = {"created_dt": datetime.now()} + rec["sites"] = {"studio": meta} return rec