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

iCloud photo.filename value not always unique #5

Open
cjenow opened this issue Dec 4, 2024 · 0 comments
Open

iCloud photo.filename value not always unique #5

cjenow opened this issue Dec 4, 2024 · 0 comments

Comments

@cjenow
Copy link
Contributor

cjenow commented Dec 4, 2024

Hi @pablogzalez ,

I found that not all of my iCloud photos were backing up. When I investigated why, I realized that within my Photos album, there are some filenames that actually have more than one unique photo. The current logic assumes that the photo.filename refers to a unique photo, but this is not true. To make the filename on disk truly unique, I've locally updated a version of the code that starts like this to make the filesystem filename the (likely unique) id, followed by the filename. I noticed that some iCloud photo IDs have / characters, and I replaced those with underscores to enable them to be valid local filenames.

for index, photo in enumerate(photos_to_backup, start=1):
        print(f"⏳ Realizando backup {index}/{len(photos_to_backup)}...", end='\r')
        photo_id_with_filename = photo.id.replace("/","_") + "_" + photo.filename

I am testing this now, if it's agreed that this is a good approach, and if finally backs up my whole library (judging by size in GB on disk compared to size of Photos in iCloud), then I will clean up my code modifications & make a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant