mirror of
https://github.com/rclone/rclone.git
synced 2026-06-10 09:24:33 -04:00
iclouddrive: fix "Index has invalid data" error listing iCloud Photos
Accounts with shared-album zones (named CMM-*) returned these zones in the photos changes/database listing alongside the real photo libraries. rclone treated them as libraries and queried their albums, but these zones have no CPLAlbumByPositionLive index so the query failed with BAD_REQUEST / "Index has invalid data", aborting the whole listing. Only PrimarySync and SharedSync-* zones are photo libraries, so skip any other zone during discovery. See: https://forum.rclone.org/t/sync-to-icloud-gives-index-has-invalid-data-errors/53852
This commit is contained in:
@@ -606,6 +606,13 @@ func (ps *PhotosService) discoverLibraries(ctx context.Context) (*libraryDiscove
|
||||
continue
|
||||
}
|
||||
name := zone.ZoneID.ZoneName
|
||||
// Only PrimarySync and SharedSync-* are photo libraries. Other
|
||||
// zones (e.g. CMM-* shared-album zones) appear in changes/database
|
||||
// but have no CPLAlbumByPositionLive index, so querying their
|
||||
// albums returns BAD_REQUEST / "Index has invalid data".
|
||||
if name != "PrimarySync" && !strings.HasPrefix(name, "SharedSync") {
|
||||
continue
|
||||
}
|
||||
// SharedSync-* found in private takes precedence over shared
|
||||
if _, exists := result.libraries[name]; exists {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user