From 9165c7638ba9c32be349bf7ae83b9e85615ec3e9 Mon Sep 17 00:00:00 2001 From: sabrina-kiam <109105561+sabrina-kiam@users.noreply.github.com> Date: Tue, 15 Aug 2023 17:55:24 -0400 Subject: [PATCH] [plat-1055] revert legacy playlist route formatting in embed player to use permalink (#3824) --- packages/embed/src/components/app.jsx | 10 ++-------- .../src/components/collection/CollectionHelmet.jsx | 5 +---- .../src/components/collection/CollectionPlayerCard.jsx | 5 +---- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/packages/embed/src/components/app.jsx b/packages/embed/src/components/app.jsx index e7092ff27e9..2aa999ac347 100644 --- a/packages/embed/src/components/app.jsx +++ b/packages/embed/src/components/app.jsx @@ -435,15 +435,9 @@ const App = (props) => { const artworkURL = getArtworkUrl(tracksResponse || collectionsResponse) const artworkClickURL = - tracksResponse?.permalink || - `${collectionsResponse?.permalink}-${decodeHashId( - collectionsResponse?.id - )}` + tracksResponse?.permalink || collectionsResponse?.permalink ? stripLeadingSlash( - tracksResponse?.permalink || - `${collectionsResponse?.permalink}-${decodeHashId( - collectionsResponse?.id - )}` + tracksResponse?.permalink || collectionsResponse?.permalink ) : null const listenOnAudiusURL = artworkClickURL diff --git a/packages/embed/src/components/collection/CollectionHelmet.jsx b/packages/embed/src/components/collection/CollectionHelmet.jsx index 5fb64e0d38c..a52d6592da1 100644 --- a/packages/embed/src/components/collection/CollectionHelmet.jsx +++ b/packages/embed/src/components/collection/CollectionHelmet.jsx @@ -2,7 +2,6 @@ import { h } from 'preact' import { Helmet } from 'react-helmet' import { getAudiusHostname } from '../../util/getEnv' -import { decodeHashId } from '../../util/hashIds' const CollectionHelmet = ({ collection }) => { if (!collection) { @@ -12,9 +11,7 @@ const CollectionHelmet = ({ collection }) => { const title = `${collection.playlistName} by ${collection.user.name} • Audius` const description = `Listen on Audius: ${collection.playlistName}` const hostname = getAudiusHostname() - const url = `https://${hostname}${collection.permalink}-${decodeHashId( - collection.id - )}` + const url = `https://${hostname}${collection.permalink}` const isAlbum = collection.isAlbum const type = isAlbum ? 'MusicAlbum' : 'MusicPlaylist' const structuredData = { diff --git a/packages/embed/src/components/collection/CollectionPlayerCard.jsx b/packages/embed/src/components/collection/CollectionPlayerCard.jsx index a3edf3a1f6a..c68c9e5f5c1 100644 --- a/packages/embed/src/components/collection/CollectionPlayerCard.jsx +++ b/packages/embed/src/components/collection/CollectionPlayerCard.jsx @@ -6,7 +6,6 @@ import 'simplebar/dist/simplebar.min.css' import IconVerified from '../../assets/img/iconVerified.svg' import { isBItem } from '../../util/bitems' import { getArtworkUrl } from '../../util/getArtworkUrl' -import { decodeHashId } from '../../util/hashIds' import { stripLeadingSlash } from '../../util/stringUtil' import Artwork from '../artwork/Artwork' import AudiusLogoButton from '../button/AudiusLogoButton' @@ -93,9 +92,7 @@ const CollectionPlayerCard = ({ isTwitter }) => { const makeOnTogglePlay = (index) => () => onTogglePlay(index) - const permalink = `${stripLeadingSlash(collection.permalink)}-${decodeHashId( - collection?.id - )}` + const permalink = `${stripLeadingSlash(collection.permalink)}` return (