Skip to content

Conversation

@asherawelan
Copy link

fix: add pagination support for album folder listing

Some iCloud accounts have more albums than are returned in a single response. Previously, the _fetch_folders method only fetched the first page of albums, ignoring any continuationMarker provided by the Apple Photos API.

This patch adds support for pagination, looping through all available pages and aggregating the results. This resolves issues where certain albums (e.g. "Harry Potter") were visible in the iCloud Web UI but missing from tools like icloudpd --list-albums.

Tested manually by confirming previously missing albums now appear.

fix: add pagination support for album folder listing

Some iCloud accounts have more albums than are returned in a single response.
Previously, the `_fetch_folders` method only fetched the first page of albums,
ignoring any `continuationMarker` provided by the Apple Photos API.

This patch adds support for pagination, looping through all available pages
and aggregating the results. This resolves issues where certain albums
(e.g. "Harry Potter") were visible in the iCloud Web UI but missing from
tools like `icloudpd --list-albums`.

Tested manually by confirming previously missing albums now appear.
@AndreyNikiforov
Copy link
Collaborator

@asherawelan add test and update changelog pls

Copy link
Collaborator

@AndreyNikiforov AndreyNikiforov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add test and update changelog, pls

Add unit tests for PhotoLibrary._fetch_folders to cover album listing logic
Add TestPhotoLibraryListAlbums with tests for _fetch_folders with and without continuation markers.
@asherawelan
Copy link
Author

Tests and change log entry added

@asherawelan
Copy link
Author

@AndreyNikiforov Could you please re-review

@AndreyNikiforov
Copy link
Collaborator

@AndreyNikiforov Could you please re-review

@asherawelan pls check why lint and tests are failing. You should be able to run these checks locally

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

Successfully merging this pull request may close these issues.

2 participants