Rename Remove-PlaylistItems $Track param to $Item#79
Rename Remove-PlaylistItems $Track param to $Item#79wardbox merged 2 commits intomainwardbox/spotishell:mainfrom fix/remove-playlist-items-param-renamewardbox/spotishell:fix/remove-playlist-items-param-renameCopy head branch name to clipboard
Conversation
Aligns parameter naming with the API's "items" terminology.
Adds [Alias('Track')] for backward compatibility.
Closes #72
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughRenamed the public parameter from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Spotishell/Public/Playlists/Remove-PlaylistItems.ps1`:
- Around line 11-12: Update the help/example description in the
Remove-PlaylistItems.ps1 example so it matches the example payload cardinality:
change the phrase "Removes all occurrences of both items in the specific
snapshot with Id 'mySuperPlaylistSnapshot' of the playlist" to use singular
wording such as "Removes all occurrences of the item in the specific snapshot
with Id 'mySuperPlaylistSnapshot' of the playlist" to reflect the single-item
example shown.
- Around line 45-47: The final-batch slice $Item[$i..($i + 99)] can produce
out-of-range indices that yield $nulls; change the slicing in the loop that
builds $BodyHashtable (the items key) to compute an end index = Min($i + 99,
$Item.Count - 1) and use $Item[$i..$end] (or otherwise take a subarray from $i
with length min(100, $Item.Count - $i)) so the items array contains only valid
entries before JSON serialization and sending to the Spotify API.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d9861692-6098-4385-9069-6f06ac95d830
📒 Files selected for processing (1)
Spotishell/Public/Playlists/Remove-PlaylistItems.ps1
…tems - Fix example description saying "both items" when only one item is shown - Use [Math]::Min to clamp slice end index, preventing trailing $null values in the JSON payload on the final batch Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
$Trackparameter to$IteminRemove-PlaylistItemsto align with the API'sitemsterminology[Alias('Track')]so existing scripts using-Trackcontinue to work-ItemFollow-up to #77 — this change was prepared but not included in the original merge.
Closes #72
Related to #70
Checklist
Invoke-Pester— 58/58 passingTest plan
Remove-PlaylistItemsaccepts-Itemparameter[Alias('Track')]preserves backward compatibility🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Refactor
New Features