Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retrieve complete album list in _fetch_folders #410

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

gordonaspin
Copy link

Proposed change

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New service (thank you!)
  • New feature (which adds functionality to an existing service)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests
  • Documentation or code sample

Example of code:

def _fetch_folders(self):
    url = f"{self.service_endpoint}/records/query?{urlencode(self.params)}"
    json_data = (
        '{"query":{"recordType":"CPLAlbumByPositionLive"},'
        '"zoneID":{"zoneName":"PrimarySync"}}'
    )

    request = self.session.post(
        url, data=json_data, headers={"Content-type": "text/plain"}
    )

    response = request.json()

    records = response["records"]
    while 'continuationMarker' in response:
        json_data = (
        '{"query":{"recordType":"CPLAlbumByPositionLive"},'
        '"zoneID":{"zoneName":"PrimarySync"},'
        '"continuationMarker":"' + response['continuationMarker'] + '"}'
        )
        request = self.session.post(
            url, data=json_data, headers={"Content-type": "text/plain"}
        )
        response = request.json()
        records.extend(response["records"])

    return records

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

  • Documentation added/updated to README

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.

Only the first 209 albums listed using api.photos.albums
1 participant