Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Rename Remove-PlaylistItems $Track param to $Item#79

Merged
wardbox merged 2 commits into
mainwardbox/spotishell:mainfrom
fix/remove-playlist-items-param-renamewardbox/spotishell:fix/remove-playlist-items-param-renameCopy head branch name to clipboard
Mar 14, 2026
Merged

Rename Remove-PlaylistItems $Track param to $Item#79
wardbox merged 2 commits into
mainwardbox/spotishell:mainfrom
fix/remove-playlist-items-param-renamewardbox/spotishell:fix/remove-playlist-items-param-renameCopy head branch name to clipboard

Conversation

@wardbox

@wardbox wardbox commented Mar 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Renames $Track parameter to $Item in Remove-PlaylistItems to align with the API's items terminology
  • Adds [Alias('Track')] so existing scripts using -Track continue to work
  • Updates help examples and documentation to use -Item

Follow-up to #77 — this change was prepared but not included in the original merge.

Closes #72
Related to #70

Checklist

Test plan

  • Module imports successfully
  • Remove-PlaylistItems accepts -Item parameter
  • [Alias('Track')] preserves backward compatibility
  • All 58 Pester tests pass locally

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated parameter docs and usage examples for playlist item removal to reflect the new parameter name and the added application-name option.
  • Refactor

    • Renamed the primary playlist-item parameter for clearer semantics; backwards compatibility preserved via an alias so existing scripts keep working.
  • New Features

    • Added an optional ApplicationName parameter to provide caller identification in requests.

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>
@coderabbitai

coderabbitai Bot commented Mar 14, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3116157f-0718-40f5-9c73-ff9cd002f0bb

📥 Commits

Reviewing files that changed from the base of the PR and between 705aaaf and 31c2a7b.

📒 Files selected for processing (1)
  • Spotishell/Public/Playlists/Remove-PlaylistItems.ps1

Walkthrough

Renamed the public parameter from Track to Item in Remove-PlaylistItems, added an [Alias('Track')] to preserve compatibility, introduced a new ApplicationName parameter, and updated the function body and docs to iterate and build request bodies from Item with safe chunking logic.

Changes

Cohort / File(s) Summary
Playlist remove parameter & logic
Spotishell/Public/Playlists/Remove-PlaylistItems.ps1
Renamed public parameter $Track$Item and added [Alias('Track')]; added [string] $ApplicationName parameter; updated internal loop to iterate over $Item.Count and build request body using $Item[$i..$end] with end computed as Min($i + 99, $Item.Count - 1); updated help, examples, and .PARAMETER docs to reference Item.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I swapped a Track for an Item today,
Alias held hands so no calls went astray.
A new name, a new field, the loop hops along—
Tiny changes, big dances, a rabbit's short song. 🎶

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly and specifically describes the main change: renaming the $Track parameter to $Item in Remove-PlaylistItems.
Description check ✅ Passed Description includes summary of changes, closure of linked issues, checklist completion evidence, and local test verification.
Linked Issues check ✅ Passed The PR successfully addresses issue #72's requirement to rename request parameter tracks to items in Remove-PlaylistItems by renaming the $Track parameter to $Item.
Out of Scope Changes check ✅ Passed All changes are scoped to the Remove-PlaylistItems function parameter rename and alias addition, directly addressing linked issue #72 without extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

@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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 90ba4a8 and 705aaaf.

📒 Files selected for processing (1)
  • Spotishell/Public/Playlists/Remove-PlaylistItems.ps1

Comment thread Spotishell/Public/Playlists/Remove-PlaylistItems.ps1 Outdated
Comment thread Spotishell/Public/Playlists/Remove-PlaylistItems.ps1 Outdated
…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>
@wardbox
wardbox merged commit 40314e9 into main Mar 14, 2026
6 checks passed
@wardbox
wardbox deleted the fix/remove-playlist-items-param-rename branch March 14, 2026 23:02
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.