Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Add Items to a Playlist",
description: "Add one or more items to a user’s playlist. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/add-tracks-to-playlist).",
key: "spotify-add-items-to-playlist",
version: "0.1.1",
version: "0.1.2",
type: "action",
props: {
spotify,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Create a Playlist",
description: "Create a playlist for a Spotify user. The playlist will be empty until you add tracks. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/create-playlist).",
key: "spotify-create-playlist",
version: "0.1.1",
version: "0.1.2",
type: "action",
props: {
spotify,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
name: "Get Album Tracks",
description: "Get all tracks in an album. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/get-an-albums-tracks)",
key: "spotify-get-album-tracks",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
spotify,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Get All Tracks by Artist",
description: "Get Spotify tracks information related with an artist's. [see docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-multiple-albums).",
key: "spotify-get-all-tracks-by-artist",
version: "0.1.1",
version: "0.1.2",
type: "action",
props: {
spotify,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Get an Artist's Top Tracks",
description: "Get Spotify catalog information about an artist’s top tracks by country. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-artists-top-tracks).",
key: "spotify-get-artist-top-tracks",
version: "0.1.1",
version: "0.1.2",
type: "action",
props: {
spotify,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Get Audio Features for a Track",
description: "Get audio feature information for a single track identified by its unique Spotify ID. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-audio-features).",
key: "spotify-get-audio-features-for-a-track",
version: "0.1.1",
version: "0.1.2",
type: "action",
props: {
spotify,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Get a Category's Playlists",
description: "Get a list of Spotify playlists tagged with a particular category. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-a-categories-playlists).",
key: "spotify-get-categorys-playlist",
version: "0.1.1",
version: "0.1.2",
type: "action",
props: {
spotify,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
description:
"Get the object currently being played on the user's Spotify account. [See the documentation](https://developer.spotify.com/documentation/web-api/reference/get-the-users-currently-playing-track)",
key: "spotify-get-currently-playing-track",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
spotify,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Get a Playlist's Items",
description: "Get full details of the items of a playlist owned by a Spotify user. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-playlists-tracks).",
key: "spotify-get-playlist-items",
version: "0.1.1",
version: "0.1.2",
type: "action",
props: {
spotify,
Expand Down
4 changes: 2 additions & 2 deletions components/spotify/actions/get-playlist/get-playlist.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
name: "Get a Playlist",
description: "Get a playlist owned by a Spotify user. [See the documentation](https://developer.spotify.com/documentation/web-api/reference/get-playlist).",
key: "spotify-get-playlist",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
spotify,
Expand All @@ -23,7 +23,7 @@ export default {

const response = await spotify.getPlaylist({
$,
playlistId: playlistId.value,
playlistId,
});

$.export("$summary", `The playlist with Id: ${playlistId.value} was successfully fetched!`);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix inconsistent property access in summary export

The summary export still references playlistId.value, but since playlistId can now be a primitive value (when using custom expressions), this will cause a runtime error when .value is undefined.

Apply this diff to handle both object and primitive playlist ID values:

-    $.export("$summary", `The playlist with Id: ${playlistId.value} was successfully fetched!`);
+    $.export("$summary", `The playlist with Id: ${playlistId.value || playlistId} was successfully fetched!`);

Alternatively, use the same pattern as other Spotify actions with lodash:

+import get from "lodash/get.js";
+
 import spotify from "../../spotify.app.mjs";
-    $.export("$summary", `The playlist with Id: ${playlistId.value} was successfully fetched!`);
+    $.export("$summary", `The playlist with Id: ${get(playlistId, "value", playlistId)} was successfully fetched!`);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$.export("$summary", `The playlist with Id: ${playlistId.value} was successfully fetched!`);
$.export("$summary", `The playlist with Id: ${playlistId.value || playlistId} was successfully fetched!`);
🤖 Prompt for AI Agents
In components/spotify/actions/get-playlist/get-playlist.mjs at line 29, the
summary export incorrectly accesses playlistId.value, which causes errors when
playlistId is a primitive. Update the code to safely handle both object and
primitive playlistId by checking if playlistId has a value property before
accessing it, or use lodash's get method as done in other Spotify actions to
retrieve the ID safely for the summary string.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Get Recommendations",
description: "Create a list of recommendations based on the available information for a given seed entity and matched against similar artists and tracks. If there is sufficient information about the provided seeds, a list of tracks will be returned together with pool size details. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-recommendations).",
key: "spotify-get-recommendations",
version: "0.1.1",
version: "0.1.2",
type: "action",
props: {
spotify,
Expand Down
2 changes: 1 addition & 1 deletion components/spotify/actions/get-track/get-track.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Get a Track",
description: "Get a track by its name or ID. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/search)",
key: "spotify-get-track",
version: "0.1.1",
version: "0.1.2",
type: "action",
props: {
spotify,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Remove Items from a Playlist",
description: "Remove one or more items from a user’s playlist. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/remove-tracks-playlist)",
key: "spotify-remove-items-from-playlist",
version: "0.1.1",
version: "0.1.2",
type: "action",
props: {
spotify,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Remove User's Saved Tracks",
description: "Remove one or more tracks from the current user’s ‘Your Music’ library. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/remove-tracks-user)",
key: "spotify-remove-user-saved-tracks",
version: "0.1.1",
version: "0.1.2",
type: "action",
props: {
spotify,
Expand Down
2 changes: 1 addition & 1 deletion components/spotify/actions/save-track/save-track.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Save Tracks for User",
description: "Save one or more tracks to the current user’s \"Your Music\" library. [See the docs here](https://developer.spotify.com/documentation/web-api/reference/#/operations/save-tracks-user).",
key: "spotify-save-track",
version: "0.1.1",
version: "0.1.2",
type: "action",
props: {
spotify,
Expand Down
2 changes: 1 addition & 1 deletion components/spotify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/spotify",
"version": "0.7.2",
"version": "0.7.3",
"description": "Pipedream Spotify Components",
"main": "spotify.app.mjs",
"keywords": [
Expand Down
1 change: 0 additions & 1 deletion components/spotify/spotify.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export default {
type: "string",
label: "Playlist ID",
description: "Select an existing playlist or pass a custom expression to reference a specific [`playlist_id`](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids) (for example, `3cEYpjA9oz9GiPac4AsH4n`).",
withLabel: true,
async options({ page }) {
const limit = 20;
const playlists = await this.getPlaylists({
Expand Down
15 changes: 5 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading