From 54e9f61c953466777a7763756a63b27568ab1dbf Mon Sep 17 00:00:00 2001 From: Katelyn Dickey Date: Fri, 19 Jun 2026 14:57:32 -0400 Subject: [PATCH] fix(SharePlayer): fallback to playlist ID for empty playlist descriptions --- ui/src/share/SharePlayer.jsx | 7 +++++-- ui/src/share/SharePlayer.test.jsx | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/ui/src/share/SharePlayer.jsx b/ui/src/share/SharePlayer.jsx index b0414cd01..ed114d4b3 100644 --- a/ui/src/share/SharePlayer.jsx +++ b/ui/src/share/SharePlayer.jsx @@ -103,7 +103,7 @@ const SharePlayer = () => { /> @@ -126,9 +126,12 @@ const SharePlayer = () => { startIcon={} disabled={!shareInfo} onClick={() => { + let url = shareDownloadUrl(shareInfo?.id) downloadFile( shareDownloadUrl(shareInfo?.id), - shareInfo?.description + '.zip', + shareInfo?.description && shareInfo.description.trim() !== '' + ? shareInfo.description + '.zip' + : shareInfo?.id + '.zip', ) setDownloadInfo(null) }} diff --git a/ui/src/share/SharePlayer.test.jsx b/ui/src/share/SharePlayer.test.jsx index dad0acad7..7b2615986 100644 --- a/ui/src/share/SharePlayer.test.jsx +++ b/ui/src/share/SharePlayer.test.jsx @@ -212,6 +212,28 @@ describe('SharePlayer', () => { expect(createdLinks[0]).not.toBeInTheDocument() }) + it('fallback to share id if description is empty', () => { + configModule.shareInfo.description = '' + + render( + + + , + ) + + capturedCustomDownloader({ src: '/share/s/track-1' }) + + fireEvent.click( + screen.getByText('resources.share.actions.download.allTracks'), + ) + + expect(createdLinks).toHaveLength(1) + expect(createdLinks[0].href).toContain('/share/d/share-1') + expect(createdLinks[0].download).toBe('share-1.zip') + expect(createdLinks[0].click).toHaveBeenCalled() + expect(createdLinks[0]).not.toBeInTheDocument() + }) + it('closes the dialog after clicking "All Tracks"', async () => { render(