Skip to content

feat: list ordered playlist items #23

Description

@rianjs

Goal

List a playlist's contents in stable order with the positional information required by later exact mutations.

Depends on #22.

Surface

  • sptfy playlists items list <playlist-reference>
  • Supports -m/--max (1-50), --next-page-token, --id, --extended, --fields, and --include-artwork.

Constraints

  • Use Spotify's current GET /playlists/{id}/items endpoint, not the deprecated /tracks surface.
  • Output always has an absolute zero-based POSITION in its normal shape and an explicit TYPE; track rows retain artist and album breadcrumbs.
  • Safely represent episode, local, unavailable/null, and future unknown item shapes without panics or fabricated track metadata. Mutation support remains track-only until separately shipped.
  • Render the playlist parent identity once rather than repeating playlist metadata in each row.
  • --id remains pure item IDs. Other shape flags follow existing precedence and text-only rules.
  • Bind opaque continuation tokens to the playlist-items surface and parsed playlist ID; never follow provider URLs.
  • Preserve provider order exactly and validate page metadata before rendering.
  • Update the behavioral spec, README, and smoke documentation only for this shipped surface.

Empirical acceptance criteria

  • Provider tests prove the exact request path, 1/50 bounds, offsets, fixed origin, response validation, and no provider-pagination following.
  • Command tests cover absolute positions across resumed pages, track breadcrumbs, each non-track/null/local shape, empty pages, shape flags, and parent rendering.
  • Wrong-kind references, malformed or cross-playlist tokens, unknown fields, and invalid bounds fail before unintended provider requests.
  • The opt-in live smoke lists a dedicated playlist fixture with at least three ordered items, proves positions match Spotify's actual order, and proves continuation resumes at the correct absolute position.
  • The static live-smoke test exercises the same assertions without network access.
  • make check, make snapshot, and the opt-in ordered-items smoke pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions