Skip to content

Add expiration date support for shared links #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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