diff --git a/gazu/asset.py b/gazu/asset.py index 9614e1e..1752609 100644 --- a/gazu/asset.py +++ b/gazu/asset.py @@ -169,6 +169,7 @@ def new_asset( description=None, extra_data={}, episode=None, + is_shared=False, client=default, ): """ @@ -181,6 +182,7 @@ def new_asset( description (str): Additional information. extra_data (dict): Free field to add any kind of metadata. episode (str / dict): The episode this asset is linked to. + is_shared (bool): True if asset is shared between multiple projects. Returns: dict: Created asset. @@ -189,7 +191,7 @@ def new_asset( asset_type = normalize_model_parameter(asset_type) episode = normalize_model_parameter(episode) - data = {"name": name, "data": extra_data} + data = {"name": name, "data": extra_data, "is_shared": is_shared} if description is not None: data["description"] = description diff --git a/gazu/files.py b/gazu/files.py index edfbe9f..532efb3 100644 --- a/gazu/files.py +++ b/gazu/files.py @@ -147,7 +147,7 @@ def get_preview_file(preview_file_id, client=default): return raw.fetch_one("preview-files", preview_file_id, client=client) -def remove_preview_file(preview_file, client=default): +def remove_preview_file(preview_file, force=False, client=default): """ Remove given preview file from database. @@ -155,8 +155,12 @@ def remove_preview_file(preview_file, client=default): preview_file (str / dict): The preview_file dict or ID. """ preview_file = normalize_model_parameter(preview_file) + params = {} + if force: + params = {"force": True} return raw.delete( "data/preview-files/%s" % preview_file["id"], + params=params, client=client, ) diff --git a/gazu/task.py b/gazu/task.py index 1796409..a455e83 100644 --- a/gazu/task.py +++ b/gazu/task.py @@ -675,13 +675,15 @@ def remove_task(task, client=default): raw.delete("data/tasks/%s" % task["id"], {"force": True}, client=client) -def start_task(task, started_task_status=None, client=default): +def start_task(task, started_task_status=None, person=None, client=default): """ Create a comment to change task status to started_task_status (by default WIP) and set its real start date to now. Args: task (str / dict): The task dict or the task ID. + started_task_status (str / dict): The task status dict or ID. + person (str / dict): The person dict or the person ID. Returns: dict: Created comment. @@ -700,7 +702,7 @@ def start_task(task, started_task_status=None, client=default): ) ) - return add_comment(task, started_task_status, client=client) + return add_comment(task, started_task_status, person=person, client=client) def task_to_review(