Skip to content

Commit 7bf3707

Browse files
committed
update public api
1 parent 0440bf2 commit 7bf3707

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

ayon_api/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@
214214
get_thumbnail_by_id,
215215
get_thumbnail,
216216
get_folder_thumbnail,
217+
get_task_thumbnail,
217218
get_version_thumbnail,
218219
get_workfile_thumbnail,
219220
create_thumbnail,
@@ -459,6 +460,7 @@
459460
"get_thumbnail_by_id",
460461
"get_thumbnail",
461462
"get_folder_thumbnail",
463+
"get_task_thumbnail",
462464
"get_version_thumbnail",
463465
"get_workfile_thumbnail",
464466
"create_thumbnail",

ayon_api/_api.py

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5698,9 +5698,10 @@ def get_thumbnail_by_id(
56985698
) -> ThumbnailContent:
56995699
"""Get thumbnail from server by id.
57005700
5701-
Permissions of thumbnails are related to entities so thumbnails must
5702-
be queried per entity. So an entity type and entity type is required
5703-
to be passed.
5701+
Warnings:
5702+
Please keep in mind that used endpoint is allowed only for admins
5703+
and managers. Use 'get_thumbnail' with entity type and id
5704+
to allow access for artists.
57045705
57055706
Notes:
57065707
It is recommended to use one of prepared entity type specific
@@ -5736,7 +5737,7 @@ def get_thumbnail(
57365737
"""Get thumbnail from server.
57375738
57385739
Permissions of thumbnails are related to entities so thumbnails must
5739-
be queried per entity. So an entity type and entity type is required
5740+
be queried per entity. So an entity type and entity id is required
57405741
to be passed.
57415742
57425743
Notes:
@@ -5794,6 +5795,28 @@ def get_folder_thumbnail(
57945795
)
57955796

57965797

5798+
def get_task_thumbnail(
5799+
project_name: str,
5800+
task_id: str,
5801+
) -> ThumbnailContent:
5802+
"""Prepared method to receive thumbnail for task entity.
5803+
5804+
Args:
5805+
project_name (str): Project under which the entity is located.
5806+
task_id (str): Folder id for which thumbnail should be returned.
5807+
5808+
Returns:
5809+
ThumbnailContent: Thumbnail content wrapper. Does not have to be
5810+
valid.
5811+
5812+
"""
5813+
con = get_server_api_connection()
5814+
return con.get_task_thumbnail(
5815+
project_name=project_name,
5816+
task_id=task_id,
5817+
)
5818+
5819+
57975820
def get_version_thumbnail(
57985821
project_name: str,
57995822
version_id: str,

0 commit comments

Comments
 (0)