Skip to content

Conversation

TRoc81
Copy link

@TRoc81 TRoc81 commented Feb 12, 2024

Added support for expiration date on shared links

Added support for expiration date on shared links
Updated comments for expiration date

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might suggest snake casing the two words expire_date as they are camel cased in the official API:

https://doc.owncloud.com/server/next/developer_manual/core/apis/ocs-share-api.html#create-a-new-share

@onyx-and-iris
Copy link

Good update, it would be worth adding expiration to the returned ShareInfo object as well.

Here's an example implementation, perhaps it can be improved upon:

                "name": data_el.find("name").text,
                "expiration": int(
                    round(
                        datetime.datetime.strptime(
                            data_el.find("expiration").text, "%Y-%m-%d %H:%M:%S"
                        ).timestamp()
                    )
                ),

It would also be worth expanding the test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants