picasawebsync
picasawebsync copied to clipboard
DELETE REMOTE delete max 1000 photos.
Hello,
I need to exec several times the script to delete all remote photos. Because script delete only mas 1000 photos.
Is that normal?
Finished transferring files. Total files found 2581, composed of {'DELETE_REMOTE': 1000, 'SILENT': 1581, 'UPLOAD_LOCAL': 0, 'UPDATE_REMOTE_METADATA': 0, 'DELETE_LOCAL': 0, 'TAG_REMOTE': 0, 'DOWNLOAD_REMOTE': 0, 'REPORT': 0, 'REPLACE_REMOTE_WITH_LOCAL': 0}
On the next sync, would you see DELETE_REMOTE: 1000 and Silent: 581?
No after 4 or 5 times it' every time the same
Finished transferring files. Total files found 2581, composed of {'DELETE_REMOTE': 1000, 'SILENT': 1581, 'UPLOAD_LOCAL': 0, 'UPDATE_REMOTE_METADATA': 0, 'DELETE_LOCAL': 0, 'TAG_REMOTE': 0, 'DOWNLOAD_REMOTE': 0, 'REPORT': 0, 'REPLACE_REMOTE_WITH_LOCAL': 0}
but every times 1000 images are deleted
(I have 33000 photos to delete and only 2581 need to stay)
OK. What's happening is that by default the API we use only returns 1000 items, which we compare with what is local and then remove those that aren't there. I think if we scanned more we would delete more so the bit that needs to be changed is
to change scanWebPhotos from:
gd_client.GetFeed(webAlbum.GetPhotosUri() + "&imgmax=d")
to
gd_client.GetFeed(webAlbum.GetPhotosUri() + "&imgmax=d&max-results=100000")
using the max-results param from https://developers.google.com/picasa-web/docs/2.0/reference
Let me know if it works and/or submit a merge request.
Any feedback on whether it works? I'm keen to get feedback and close the ticket if possible.