icloud-photos-downloader / icloud_photos_downloader

A command-line tool to download photos from iCloud
MIT License
6.75k stars 548 forks source link

Downloading Deleted Files... only to delete them? #511

Open michaelkrieger opened 1 year ago

michaelkrieger commented 1 year ago

Overview

With the latest update I've noticed a large number of deleted images- many more than I would ever delete each day (60-80).

Looking at the logs, the app is downloading images, and in the same run deleting the very same files it just downloaded (by file name). The logs have nothing interesting in the preamble or file list, except, after it reviews the deduplicated files and downloaded files, it reviews the deleted files and deletes a bunch of files it just downloaded (about 60-80 each time).

Why is it downloading the recently deleted images and subsequently deleting them?

Steps to Reproduce

I add 30-40 photos to my phone icloudPD downloads 122 icloudPD deletes 62 The next day it downloads the same deleted images and re-deletes them.

Expected Behavior

It should not download recently deleted.

Actual Behavior

It downloads recently deleted and then deletes them.

Context

Crossposted to https://github.com/boredazfcuk/docker-icloudpd/issues/249 in case one is the culprit.

AndreyNikiforov commented 1 year ago

@michaelkrieger Thanks for sharing details. IIUC delete functionality runs at the end of the processing if enabled and this behavior was there from the initial implementation.

With the latest update...

What update are you referring to? Latest official release is 1.7.2 from Jan 2021...

michaelkrieger commented 1 year ago

@michaelkrieger Thanks for sharing details. IIUC delete functionality runs at the end of the processing if enabled and this behavior was there from the initial implementation. What update are you referring to? Latest official release is 1.7.2 from Jan 2021... Yes using icloudpd, version 1.7.2, but using it within the docker-icloudpd container which adds lots of wrapper scripts. I'm guessing the bug is better addressed on that side. Will update here if it turns out to be something with icloudpd. There were some recent updates to the scripts in that container.

AndreyNikiforov commented 1 year ago

Related to #196

holomekc commented 3 months ago

Hi @AndreyNikiforov Hmm I think this still happens right? Running the tool via docker twice, both runs downloads for example IMG_1.HEIC, but then in the deletion step realize that it should be removed.

In my head it should be possible to check the recently deleted "folder" to keep in memory, which images, videos are already deleted and during download phase they should not be downloaded but instead skipped.

Or am I mistaken?

AndreyNikiforov commented 3 months ago

Hi @AndreyNikiforov Hmm I think this still happens right? Running the tool via docker twice, both runs downloads for example IMG_1.HEIC, but then in the deletion step realize that it should be removed.

In my head it should be possible to check the recently deleted "folder" to keep in memory, which images, videos are already deleted and during download phase they should not be downloaded but instead skipped.

Or am I mistaken?

Haven't not look at the yet ;-( My gut feeling is that name-id7 policy may have that problem to a lesser degree (or not at all)