Skip to content

Finding files by modified date returns incorrect results #347

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

Closed
yuretzgt opened this issue Apr 11, 2025 · 1 comment · Fixed by #358
Closed

Finding files by modified date returns incorrect results #347

yuretzgt opened this issue Apr 11, 2025 · 1 comment · Fixed by #358
Labels
bug Something isn't working enhancement New feature or request fixed in upcoming release fix will arrive with next release

Comments

@yuretzgt
Copy link

Describe the bug

search_date = datetime.datetime.now().replace(day=10) #wanna get files modified within last 24 hours
len(nc.files.find(["gt","last_modified",search_date],"search_folder")) # return files count in folder
len(nc.files.find(["lt","last_modified",search_date],"search_folder")) # return 0

Also there is a bug in docs
Image

Steps/Code to Reproduce

Just try to find with date modified with more and less than any value

Expected Results

List files that modified from provided date

Actual Results

All files when GT
Zero files when LT

Setup configuration

nc_py_api == 0.19.2
nextcloud == 30

@bigcat88
Copy link
Member

bigcat88 commented May 1, 2025

{DAV:}getlastmodified is a Datetime property, so Nextcloud expects the literal in ISO-8601 (or HTTP-date) format, including the “T” separator and a time-zone designator.

So it is somewhere between feature request and a bug, but closer to first, imho.

Will try to add support for this...

@bigcat88 bigcat88 added enhancement New feature or request bug Something isn't working labels May 1, 2025
@bigcat88 bigcat88 added the fixed in upcoming release fix will arrive with next release label May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request fixed in upcoming release fix will arrive with next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants