Skip to content

Rename playlist /tracks endpoints to /items - #77

Merged
wardbox merged 2 commits into
mainfrom
fix/playlist-tracks-to-items
Mar 14, 2026
Merged

Rename playlist /tracks endpoints to /items#77
wardbox merged 2 commits into
mainfrom
fix/playlist-tracks-to-items

Conversation

@wardbox

@wardbox wardbox commented Mar 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Migrates all playlist item management endpoints from /playlists/{id}/tracks to /playlists/{id}/items per Spotify's Feb 2026 API changes
  • Updates the Remove-PlaylistItems request body key from tracks to items
  • Renames $Track parameter to $Item with [Alias('Track')] for backward compatibility
  • Affects 5 files: Get-PlaylistItems, Add-PlaylistItem, Remove-PlaylistItems, Edit-PlaylistOrder, Set-PlaylistItems

Closes #72
Related to #70

Checklist

Test plan

  • Module imports successfully with Import-Module ./Spotishell/Spotishell.psd1 -Force
  • All 5 affected cmdlets load and reference /items endpoint
  • No remaining references to /tracks in playlist endpoint URLs
  • Remove-PlaylistItems body uses items key instead of tracks
  • -Track alias still works for backward compatibility

🤖 Generated with Claude Code

Spotify's Feb 2026 API update renames all playlist track management
endpoints from /playlists/{id}/tracks to /playlists/{id}/items, and
the request body key from "tracks" to "items".

Closes #72

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 14, 2026

Copy link
Copy Markdown

Walkthrough

Five playlist-management scripts and a test were updated to use Spotify's renamed playlist endpoints: /v1/playlists/{id}/tracks/v1/playlists/{id}/items. One script also updates the request-body key from tracks to items.

Changes

Cohort / File(s) Summary
Endpoint Path Updates
Spotishell/Public/Playlists/Add-PlaylistItem.ps1, Spotishell/Public/Playlists/Edit-PlaylistOrder.ps1, Spotishell/Public/Playlists/Get-PlaylistItems.ps1, Spotishell/Public/Playlists/Set-PlaylistItems.ps1
Replaced API path /v1/playlists/{Id}/tracks with /v1/playlists/{Id}/items. Request construction, payload shape, and iteration logic unchanged.
Endpoint + Payload Key Update
Spotishell/Public/Playlists/Remove-PlaylistItems.ps1
Replaced API path /v1/playlists/{Id}/tracks with /v1/playlists/{Id}/items and renamed request-body key from tracks to items. Batching and snapshot_id handling preserved.
Tests Updated
Tests/Spotishell.Tests.ps1
Updated mocked expectation(s) to assert requests target /v1/playlists/{playlistId}/items instead of /tracks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hopped through code to make things right,

/tracks now hops to /items in sight,
Five scripts aligned, one test did cheer,
A tiny change — the path is clear,
Carrots for CI, and a joyful ear 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Rename playlist /tracks endpoints to /items' clearly and concisely summarizes the main change in the PR.
Linked Issues check ✅ Passed All five affected files have been updated with endpoint changes from /tracks to /items, request body key updated, and tests modified accordingly.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue #72 objective of migrating endpoints from /tracks to /items across the five specified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description comprehensively covers the changes, provides detailed checklists with verification status, and links to related issues.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
Spotishell/Public/Playlists/Remove-PlaylistItems.ps1 (1)

30-32: Consider renaming the $Track parameter to $Item for consistency.

The parameter is still named $Track (line 32) and referenced as -Track in examples (lines 5, 8, 11), while the API now uses items terminology. For consistency with the new API and the body key change, consider renaming this parameter in a future update.

This is a breaking change for existing scripts, so if backward compatibility is a concern, you could add a parameter alias:

♻️ Suggested approach with backward compatibility
 [Parameter(Mandatory, ValueFromPipeline)]
+[Alias('Track')]
 [array]
-$Track,
+$Item,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Spotishell/Public/Playlists/Remove-PlaylistItems.ps1` around lines 30 - 32,
The parameter $Track in Remove-PlaylistItems.ps1 should be renamed to $Item to
match the API's "items" terminology and the body key change; update the
parameter declaration (currently "[array] $Track") and all internal references
to use $Item, and if you need backward compatibility add an Alias for the old
name (e.g., apply an Alias attribute referencing "Track") so callers using
-Track keep working while new code uses -Item.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@Spotishell/Public/Playlists/Remove-PlaylistItems.ps1`:
- Around line 30-32: The parameter $Track in Remove-PlaylistItems.ps1 should be
renamed to $Item to match the API's "items" terminology and the body key change;
update the parameter declaration (currently "[array] $Track") and all internal
references to use $Item, and if you need backward compatibility add an Alias for
the old name (e.g., apply an Alias attribute referencing "Track") so callers
using -Track keep working while new code uses -Item.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 05012734-2e27-4dda-8b38-5d34025d9e1b

📥 Commits

Reviewing files that changed from the base of the PR and between 7bfd599 and 4d53fd2.

📒 Files selected for processing (5)
  • Spotishell/Public/Playlists/Add-PlaylistItem.ps1
  • Spotishell/Public/Playlists/Edit-PlaylistOrder.ps1
  • Spotishell/Public/Playlists/Get-PlaylistItems.ps1
  • Spotishell/Public/Playlists/Remove-PlaylistItems.ps1
  • Spotishell/Public/Playlists/Set-PlaylistItems.ps1

@wardbox wardbox self-assigned this Mar 14, 2026
@wardbox
wardbox merged commit 90ba4a8 into main Mar 14, 2026
6 checks passed
@wardbox
wardbox deleted the fix/playlist-tracks-to-items branch March 14, 2026 21:32
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.

Rename playlist /tracks endpoints to /items

1 participant