steilerDev / icloud-photos-sync

One-way sync engine for the iCloud Photos Library into the native file system
https://icps.steiler.dev/
GNU General Public License v3.0
340 stars 9 forks source link

Feature Request: Shared Library - Existing Content Check #298

Closed undaunt closed 11 months ago

undaunt commented 1 year ago

Operating environment

My use case is that I am backing up both my, and my wife's photo libraries and we share our library with each other. Thus, right now I am running rdfind on my parent folder where both of our libraries live to make hardlinks between the duplicate content and free up disk space.

However, it would be awesome if we could somehow split out the shared library folder location and have it be checked in case the files exist without having the _All-Photos folder get confused.

I'm running two docker containers and pointing them at /photos/icloud/me and /photos/icloud/wife currently, so content is showing up at /icloud/photos/me/_All-Photos and such, but if it were possible to do like /photos/icloud/personal-me, /photos/icloud/personal-wife, and /photos/icloud/shared-library, even better. I'm not sure it is possible if the API considers the assets to be different across the two different Apple IDs, or how you're detecting what constitutes and unique asset.

If the existing API logic would account for this, I could try and get fancy with my bind mounts and hack it into place myself.

Thanks!

Edit: Just saw this, wondering if you could allow (or already allow) specififying PRIMARY_ASSET_DIR and SHARED_ASSET_DIR as environmental variables, that could be an easy solve if I don't get into archiving anything in the shared library.

steilerDev commented 1 year ago

Basically you are asking for multi account setup (that have a jointly shared library)?

When you compare your version of the shared library and your wife's version - are the files in them identical (not only their content, but also their names)?

And if you and your wife have the same picture in both of your libraries, are those also the same (i.e. do they have the same filename?)

undaunt commented 1 year ago

Hi,

Yes, though I realized that after my wife's initial download finally finished, her shared library folder is empty because I own the shared library and invited her. If that's by design, we don't have to solve for anything here since her folder is empty.

Her All Photos folder matches roughly her total count on iCloud based on logs, whereas my All Photos + Shared Photos matches my total.

If at some point however it becomes possible for the invited member of a shared library to also have their photos downloaded, this would be something to solve for, so I'm not sure if it should be left open or not.

I will verify the filenames in our shared libraries on our phones and get back to you soon re: the last question.

Thanks!

steilerDev commented 1 year ago

Yes, though I realized that after my wife's initial download finally finished, her shared library folder is empty because I own the shared library and invited her. If that's by design, we don't have to solve for anything here since her folder is empty.

Nope that should not happen - and I thought to remember a thread where someone in a similar situation reported his shared library was getting populated, even though he does not own it (I can't repro this easily). Let me add some debugging functionality before the next release and we can investigate following this.

I believe you understood my request wrong - it's about the filenames from this tool (because those are GUIDs - or at least I'm guessing they are :D

If those GUIDs match, de-duplication would be trivial - if they don't we have a whole set of challenges.

undaunt commented 1 year ago

Ah, yeah if you meant both the file attributes being identical and also the filename, I cannot test it yet as hers is not populating, which to your point is not expected?

Sounds good, I'll stay tuned for the subsequent debugging release.

steilerDev commented 1 year ago

Yeah - it should work - on the other hand I have not tested it :D

"one last thing" for the upcoming release spiralled into a significant rewrite :D this will be focus once the next release has been done

steilerDev commented 11 months ago

See this issue for more information on this. I am also going to close this issue in favour of #354 .