Skip to content

Commit

Permalink
Merge pull request #47 from shgysk8zer0/bug/spotifiy-credentialless
Browse files Browse the repository at this point in the history
Fix missing `credentialless` for Spotify functions
  • Loading branch information
shgysk8zer0 authored Oct 31, 2023
2 parents 2b8c774 + 82af759 commit 034f34b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.2.5] - 2023-10-31

### Fixed
- Spotify embed module now supports `credentialless` in all functions

## [v0.2.4] - 2023-10-31

### Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shgysk8zer0/kazoo",
"version": "0.2.4",
"version": "0.2.5",
"private": false,
"type": "module",
"description": "A JavaScript monorepo for all the things!",
Expand Down
22 changes: 11 additions & 11 deletions spotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function uriToLink(uri) {
}

function createSpotifyIframe(type, id, { title = 'Spotify Player', large = false, credentialless = false, slot, part } = {}) {
return createIframe(policy.createScriptURL(new URL(`./${type}/${id}`, SPOTIFY)), {
return createIframe(policy.createScriptURL(new URL(`./${encodeURIComponent(type)}/${encodeURIComponent(id)}`, SPOTIFY)), {
width: 300,
height: large ? 380 : 80,
referrerPolicy: 'origin',
Expand All @@ -89,24 +89,24 @@ function createSpotifyIframe(type, id, { title = 'Spotify Player', large = false
});
}

export function createSpotifyAlbum(id, { title, large, slot, part } = {}) {
return createSpotifyIframe('album', id, { title, large, slot, part });
export function createSpotifyAlbum(id, { title, large, slot, part, credentialless } = {}) {
return createSpotifyIframe('album', id, { title, large, slot, part, credentialless });
}

export function createSpotifyArtist(id, { title, large, slot, part } = {}) {
return createSpotifyIframe('artist', id, { title, large, slot, part });
export function createSpotifyArtist(id, { title, large, slot, part, credentialless } = {}) {
return createSpotifyIframe('artist', id, { title, large, slot, part, credentialless });
}

export function createSpotifyPlaylist(id, { title, large, slot, part } = {}) {
return createSpotifyIframe('playlist', id, { title, large, slot, part });
export function createSpotifyPlaylist(id, { title, large, slot, part, credentialless } = {}) {
return createSpotifyIframe('playlist', id, { title, large, slot, part, credentialless });
}

export function createSpotifyShow(id, { title, large, slot, part } = {}) {
return createSpotifyIframe('show', id, { title, large, slot, part });
export function createSpotifyShow(id, { title, large, slot, part, credentialless } = {}) {
return createSpotifyIframe('show', id, { title, large, slot, part, credentialless });
}

export function createSpotifyTrack(id, { title, large, slot, part } = {}) {
return createSpotifyIframe('track', id, { title, large, slot, part });
export function createSpotifyTrack(id, { title, large, slot, part, credentialless } = {}) {
return createSpotifyIframe('track', id, { title, large, slot, part, credentialless });
}

export const trustPolicies = [policy.name];

0 comments on commit 034f34b

Please sign in to comment.