steilerDev/icloud-photos-sync

Archive older than XX days, continue syncing most recent

Opened this issue · 5 comments

This is obviously more of a feature request or improvement. I am curious if it's possible to combine the idea of archiving and syncing in order to reduce the number of photos in iCloud Photos but maintain the local library in perpetuity. Photos older than XX days would be "archived" but a sync action would happen for photos newer than that. This would apply to all albums and all photos. It would be helpful to have all "archived" and synced photos in the same folder, not a separate ones.

My hope is to reduce the number of photos in iCloud Photos (I have 83,000+) but keep the most recent photos on my phone (something like 90 days). If all photos are in the same folder, regardless if they're in iCloud Photos or not, I could connect the local library to another app, such as Photo Prism, to browse my entire library.

Just a thought! Cheers.

That's a really interesting idea!

I'd have to think about the implications of this, because currently archiving logic is handled on an album level (either an album is archived or it isn't, which decides if it's considered for syncing or not) and the 'All Photos' album has no understanding of archives.

The logic is there for deleting assets and I'm pulling the date metadata of the asset,
which means writing them out to an 'All photos archive' based on their age would be trivial. However I'm not sure how to handle album state in this scenario:

  • Should the file stay linked in the album after archiving?
    • What happens though if you move the album in your library - are archived assets 'moving' with the album
    • If you've archived all photos from one album (because the relevant event has been in the past far enough) you'll end up with a bunch of empty albums in your library, should we delete them remotely and maybe even locally (also what happens if you change the 'old' parent of the folder, will it move?)
  • Should there be an archived folder structure?
    • This would simplify the logic around handling remote folders
    • However this would (temporarily) put the same album in two places
  • Should we remove archived assets from the folders (which would keep them in sync with the remote state), this would however lead to less discoverability of archived assets

Let's work all of this out and then have a think about how to implement it - the folder syncing logic is generally a piece of the app that's kind of janky anyway so I wouldn't mind a rework 😅

Generally speaking this could definitely be an alternative option to the current archiving model (but would not replace it) because:

  • I want to retain some old pictures in the library, because I really like the iPhone surfacing old memories from the Home Screen widget
  • It's the way my workflow works 😂
    (but I'm already thinking about how we could combine the two...)

Yeah, interesting challenges here.

I understand that "archive" is to remove from remote and move to a new location in local. Let's put that on a shelf for a second.

Perhaps this is all to expand on the "sync" capabilities, then.

  • Add an option to delete remote files that are older than XX days SYNC_DELETE_REMOTE_OLDER_THAN=XX
  • Default action would be to retain any local files regardless if they've been removed by the delete remote action, but local files could be deleted if the delete action happened in remote by a device and not the syncing process (this would imply the photo was younger than the SYNC_DELETE_REMOTE_OLDER_THAN age or could exist in an album or could be a favorite - see further RETAIN_REMOTE options below).
  • Add an option to retain album contents on remote if the remote delete based on age is enabled. Any photos in any album would not be deleted on remote but photos not in albums would (based on age). SYNC_RETAIN_REMOTE_ALBUMS=TRUE
  • If SYNC_RETAIN_REMOTE_ALBUMS=FALSE and all of its contents are deleted on remote, the remote album is also deleted. Album(s) on local remains intact in their current folder position regardless if it exists in remote or not.
  • Add an option to retain favorites on remote if remote delete based on age is enabled SYNC_RETAIN_REMOTE_FAVORITES=TRUE
  • _All-Photos and AlbumName folders on local remain intact given all options regardless if the photo or album remains on remote. The hope is we are using iCloud Photos to continuously add to the big ole pool o' photos for use in other apps. It would be difficult to maintain separate folders in local for images that had been deleted on remote vs photos that are 'current' on remote.
  • You might want an "undo" or a local to remote sync if someone messes up their options. SEND_LOCAL_TO_REMOTE=TRUE

Just kinda talkin' out loud. Am I making sense with this direction or does it add complications?

While I also like a good configuration option, I think we need to be careful to not overload the application. Many options might lead to unexpected behaviour (maybe because of bugs or maybe because of confusion around the interaction when combining some options).

I do like SYNC_RETAIN_REMOTE_FAVORITES as well as SYNC_DELETE_REMOTE_OLDER_THAN - maybe we could simply ignore folders all together and keep them in sync until you explicitly mark a folder archived - which would then enable you to delete it remotely.

You might want an "undo" or a local to remote sync if someone messes up their options. SEND_LOCAL_TO_REMOTE=TRUE

This one might be very tricky - because I would need to figure out how uploading works (which I tried to avoid so far :D )

Independently, I think we sooner or later need to change the library structure.

I'll be adding a metadata file soon - so the library is 'versioned' allowing an upgrade somewhere in the future.

I've created a separate issue (#354) to explain my proposal for a new library version that should resolve this issue. Would therefore love to get your feedback on there.