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
347 stars 8 forks source link

Sync Hidden album #558

Open gsong opened 4 months ago

gsong commented 4 months ago

Describe the ultimate goal you want to achieve

Sync the special Hidden album.

How do you think the feature should be implemented

Hidden albums seem to require an additional step from the user.

Checklist

steilerDev commented 4 months ago

Hidden album network sync findings:

Index Count:

-> 
https://p133-ckdatabasews.icloud.com/database/1/com.apple.photos.cloud/production/private/records/query

{"query":{"recordType":"HyperionIndexCountLookup","filterBy":[{"fieldName":"indexCountID","comparator":"IN","fieldValue":{"value":["CPLAssetHiddenByAssetDate"],"type":"STRING_LIST"}}]},"zoneID":{"zoneName":"PrimarySync","ownerRecordName":"<owner>","zoneType":"REGULAR_CUSTOM_ZONE"}}

Files:

-> https://p133-ckdatabasews.icloud.com/database/1/com.apple.photos.cloud/production/private/records/query

{"query":{"recordType":"CPLAssetAndMasterHiddenByAssetDate","filterBy":[{"fieldName":"direction","comparator":"EQUALS","fieldValue":{"value":"DESCENDING","type":"STRING"}},{"fieldName":"startRank","comparator":"EQUALS","fieldValue":{"value":0,"type":"INT64"}}]},"zoneID":{"zoneName":"PrimarySync","ownerRecordName":"<owner>","zoneType":"REGULAR_CUSTOM_ZONE"},"resultsLimit":2}

Unfortunately I'm currently quite busy, so I'm not sure when I'll get around implementing this - seems feasible though.

gsong commented 4 months ago

Thank you for investigating. Whenever you can get to it would be much appreciated. And I'd be glad to help with testing.

steilerDev commented 4 months ago

btw - the files should already be present in the "All Photos" folder - it's just not linking it into the album.

gsong commented 4 months ago

Oh really? Is there an easy way to correlate any specific image to its underlying filename(s)? I know sometimes there are multiple files associated with a single image if there are edits.

steilerDev commented 3 months ago

After checking the code - I might have been wrong, because I'm syncing "WithoutHiddenOrDeleted" - so if there is no function available that also fetches Hidden records, this feature request might be larger than expected...