Skip to content

Simplify saved track pagination#36

Open
JPrier wants to merge 1 commit into
masterfrom
codex/add-sync_liked-action-to-sync-songs
Open

Simplify saved track pagination#36
JPrier wants to merge 1 commit into
masterfrom
codex/add-sync_liked-action-to-sync-songs

Conversation

@JPrier

@JPrier JPrier commented Jan 21, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Address an inline comment by simplifying the pagination loop in current_user_saved_tracks so the loop exits when the time cutoff or max_items is reached instead of embedding complex conditions per-page.

Description

  • Replace the previous paginated-collection loop with a simpler while resp.get("next"): loop that first checks len(tracks) >= max_items or reached_cutoff and breaks, keeping the same collection semantics via the existing _collect_saved_tracks helper in spotifyActionService/src/accessor/spotifyAccessor.py.
  • Commit message and diff reflect only the pagination simplification in current_user_saved_tracks (no behavioral API changes beyond the loop structure).

Testing

  • Ran linter with uvx ruff check --exit-zero . and it passed.
  • Ran the full test suite with PYTHONPATH=$PWD/spotifyActionService/src uv run --extra dev python -m coverage run --source=$PWD/spotifyActionService/src -m pytest and all tests passed (73 passed, 1 deselected).
  • Generated coverage output with uv run --extra dev coverage html and uv run --extra dev coverage report, resulting in overall coverage around 97%.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant