diff --git a/examples/as_app/to_gif/appinfo/info.xml b/examples/as_app/to_gif/appinfo/info.xml index aea88c50..7474c146 100644 --- a/examples/as_app/to_gif/appinfo/info.xml +++ b/examples/as_app/to_gif/appinfo/info.xml @@ -26,7 +26,7 @@ - 2 + 10 32 diff --git a/nc_py_api/ex_app/ui/files.py b/nc_py_api/ex_app/ui/files.py index 244d9fdc..d482800b 100644 --- a/nc_py_api/ex_app/ui/files.py +++ b/nc_py_api/ex_app/ui/files.py @@ -1,5 +1,6 @@ """Nextcloud API for working with drop-down file's menu.""" import os +import typing from datetime import datetime, timezone from pydantic import BaseModel @@ -35,8 +36,10 @@ class UiActionFileInfo(BaseModel): """Last modified time""" userId: str """The ID of the user performing the action.""" - shared: str - """**true** or **false**""" + shareOwner: typing.Optional[str] + """If the object is shared, this is a display name of the share owner.""" + shareOwnerId: typing.Optional[str] + """If the object is shared, this is the owner ID of the share.""" def to_fs_node(self) -> FsNode: """Returns created ``FsNode`` from the file info given. @@ -50,7 +53,7 @@ def to_fs_node(self) -> FsNode: user_path += "/" full_path = os.path.join(f"files/{self.userId}", user_path.lstrip("/")) - permissions = "S" if self.shared.lower() == "true" else "" + permissions = "S" if self.shareOwnerId else "" if self.permissions & FilePermissions.PERMISSION_SHARE: permissions += "R" if self.permissions & FilePermissions.PERMISSION_READ: diff --git a/tests/ui_files_test.py b/tests/ui_files_test.py index 5d926104..c18a29e4 100644 --- a/tests/ui_files_test.py +++ b/tests/ui_files_test.py @@ -104,7 +104,8 @@ def ui_action_check(directory: str, fs_object: FsNode): favorite=str(fs_object.info.favorite), permissions=permissions, userId=fs_object.user, - shared="true" if fs_object.is_shared else "false", + shareOwner="some_user" if fs_object.is_shared else None, + shareOwnerId="some_user_id" if fs_object.is_shared else None, ) fs_node = file_info.to_fs_node() assert isinstance(fs_node, FsNode)