Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Spotishell/Public/Playlists/Add-PlaylistItem.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function Add-PlaylistItem {
)

$Method = 'Post'
$Uri = "https://api.spotify.com/v1/playlists/$Id/tracks"
$Uri = "https://api.spotify.com/v1/playlists/$Id/items"

# Convert plain IDs to URIs, pass through existing URIs unchanged
# Use @() to ensure result is always an array (single items would otherwise be strings)
Expand Down
2 changes: 1 addition & 1 deletion Spotishell/Public/Playlists/Edit-PlaylistOrder.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Edit-PlaylistOrder {
)

$Method = 'Put'
$Uri = "https://api.spotify.com/v1/playlists/$Id/tracks"
$Uri = "https://api.spotify.com/v1/playlists/$Id/items"

$BodyHashtable = @{
range_start = $RangeStart
Expand Down
2 changes: 1 addition & 1 deletion Spotishell/Public/Playlists/Get-PlaylistItems.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Get-PlaylistItems {
)

$Method = 'Get'
$Uri = "https://api.spotify.com/v1/playlists/$Id/tracks?limit=100"
$Uri = "https://api.spotify.com/v1/playlists/$Id/items?limit=100"

$Query = @()
if ($Field) { $Query += 'fields=' + $Field }
Expand Down
4 changes: 2 additions & 2 deletions Spotishell/Public/Playlists/Remove-PlaylistItems.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ function Remove-PlaylistItems {
)

$Method = 'Delete'
$Uri = "https://api.spotify.com/v1/playlists/$Id/tracks"
$Uri = "https://api.spotify.com/v1/playlists/$Id/items"

for ($i = 0; $i -lt $Track.Count; $i += 100) {

$BodyHashtable = @{tracks = $Track[$i..($i + 99)] }
$BodyHashtable = @{items = $Track[$i..($i + 99)] }
if ($SnapshotId) { $BodyHashtable.snapshot_id = $SnapshotId }
$Body = ConvertTo-Json $BodyHashtable -Compress

Expand Down
2 changes: 1 addition & 1 deletion Spotishell/Public/Playlists/Set-PlaylistItems.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function Set-PlaylistItems {
)

$Method = 'Put'
$Uri = "https://api.spotify.com/v1/playlists/$Id/tracks"
$Uri = "https://api.spotify.com/v1/playlists/$Id/items"

if ($Uris) {

Expand Down
2 changes: 1 addition & 1 deletion Tests/Spotishell.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ Describe 'Add-PlaylistItem Behavior' {
Add-PlaylistItem -Id 'myplaylist789' -ItemId 'track123'

Should -Invoke Send-SpotifyCall -ModuleName Spotishell -ParameterFilter {
$Uri -eq 'https://api.spotify.com/v1/playlists/myplaylist789/tracks' -and
$Uri -eq 'https://api.spotify.com/v1/playlists/myplaylist789/items' -and
$Method -eq 'Post'
}
}
Expand Down
Loading