-
Notifications
You must be signed in to change notification settings - Fork 573
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
Auto-delete date mismatch #345
Comments
This may be a potential fix but I won't be writing a unit test to submit a pull request: |
Just came across this as well as I finally understood the intent of the --auto-delete option (since it really wasn't working due to this bug). So the only people in this world this works for 100% of the time are the ones living on the prime meridian. Is there any chance this would get fixed? It's just a few lines of code per @mkirkland4874. Willing to help, let me know. |
@steffenmartin if you can add/update tests to match these bug & fix, that would be a great help! |
Pull request #645 created. |
…oud-photos-downloader#345 Due to the usage of local time conversions tests were sensitive to execution on machines in a different time zones. Now using timestamp to get beyond this issue.
Due to the usage of local time conversions tests were sensitive to execution on machines in a different time zones. Now using timestamp to get beyond this issue. --------- Co-authored-by: Steffen Martin <[email protected]>
Overview
In certain circumstances, there is a mismatch between the date path generated in base.py and the path generated in autodelete.py for the same image. When certain images are deleted on iCloud (i.e., moved to Recently Deleted album), autodelete.py looks at the wrong path when checking if the recently deleted file exists on the local filesystem and as such, the file is not properly deleted from the local filesystem.
Steps to Reproduce
Expected Behavior
The created_date in base.py should match the created_date in autodelete.py for the same image.
Actual Behavior
Line 380 of base.py results in a created_date of 2021-06-23 17:34:45.892000-07:00 and a download path of Photos/2021/06/23/
380: created_date = photo.created.astimezone(get_localzone())
Line 21 of autodelete.py results in a created_date of 2021-06-24 00:34:45.892000+00:00 and a local path of Photos/2021/06/24/
21: created_date = media.created
Accordingly, the file on the local filesystem is actually located at Photos/2021/06/23/ but autodelete.py checks for it in folder Photos/2021/06/24/ and does not find it, so the file is not deleted from the local filesystem even though it was deleted on iCloud.
Context
N/A
The text was updated successfully, but these errors were encountered: