Skip to content
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

Added working delete function for photos #159

Merged
merged 6 commits into from Mar 20, 2020

Conversation

sbmsr
Copy link
Contributor

@sbmsr sbmsr commented Oct 25, 2017

Added working delete function for CPLAssets.

Fixes #239

@Tatsh
Copy link

Tatsh commented Nov 6, 2017

Would definitely like to see this merged. Fix the long lines:

pyicloud/services/photos.py:508:80: E501 line too long (266 > 79 characters)
pyicloud/services/photos.py:510:80: E501 line too long (82 > 79 characters)

@Tatsh
Copy link

Tatsh commented Nov 6, 2017

Also, consider making a way to batch delete. I've been posting with 100 operations at a time with no issue but I figure if you sent thousands of HTTP requests for only 1 operation that's very inefficient and the API will throttle a lot more. Perhaps like a add_to_delete_queue() method (or put this on the service and accept an asset argument) and the photos service would have a deletion queue list. On the service object you could call delete_all_in_queue() or something like that. In that method, make it delete only 100 at a time.

@Tatsh
Copy link

Tatsh commented Nov 6, 2017

For permanent deletion, use "fields":{"isExpunged":{"value":1}}}}]. Maybe accept permanent as a kwarg? Otherwise an expunge() method. Apple only does 200 at a time for this method.

@jrmlhermitte
Copy link

worked great for me. can we merge this in soon? @r3ticuli any progress?
we can add more features to it later perhaps?

@sbmsr
Copy link
Contributor Author

sbmsr commented Dec 10, 2017 via email

fr-essem and others added 5 commits December 10, 2017 22:19
now conforms to 79 char max line-length
now conforms to 79 char max line-length
@sbmsr
Copy link
Contributor Author

sbmsr commented Dec 11, 2017

done! waiting for review now.

@chadj
Copy link
Contributor

chadj commented Dec 20, 2017

@torarnv this gets a +1 from me

@jrmlhermitte
Copy link

👍 from a user
I deleted all my icloud photos using this:

photos_iter = iter(api.photos.all)
for i, photo in enumerate(photos_iter):
    print(f"Deleting file {photo.filename}")
    photo.delete()

I think I had to run it a few times (because not all files were deleted, probably an apple side bug).
But helped me become apple-free. thanks!

@Quentame Quentame changed the title added working delete function for photos Added working delete function for photos Mar 19, 2020
@Quentame Quentame added this to In progress in Dev via automation Mar 19, 2020
@Quentame Quentame added this to the 0.9.6 milestone Mar 19, 2020
@Quentame Quentame merged commit f698336 into picklepete:master Mar 20, 2020
Dev automation moved this from In progress to Done Mar 20, 2020
drizzt pushed a commit to drizzt/pyicloud that referenced this pull request Jun 18, 2021
Co-authored-by: sebastian messier <sebastian.messier@flexreceipts.com>
drizzt pushed a commit to drizzt/pyicloud that referenced this pull request Jun 18, 2021
Co-authored-by: sebastian messier <sebastian.messier@flexreceipts.com>
@sbmsr sbmsr deleted the feature/adding-delete branch March 23, 2022 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

Is there any way to delete photo?
6 participants