From 8f1994d9d38c12246650694842b89e17a6a8047c Mon Sep 17 00:00:00 2001 From: matioku Date: Fri, 20 Mar 2026 21:30:15 +0100 Subject: [PATCH] fix(events): fix share/open-in-new-tab URL construction --- js/events.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/js/events.js b/js/events.js index dcd9b2f..aebf437 100644 --- a/js/events.js +++ b/js/events.js @@ -1310,7 +1310,7 @@ export async function handleTrackAction( // Use stored href from card if available, otherwise construct URL const contextMenu = document.getElementById('context-menu'); const storedHref = contextMenu?._contextHref; - const url = getShareUrl(storedHref ? storedHref : `/track/${item.id || item.uuid}`); + const url = getShareUrl(storedHref ? storedHref : `/${type}/${item.id || item.uuid}`); trackCopyLink(type, item.id || item.uuid); navigator.clipboard.writeText(url).then(() => { @@ -1322,7 +1322,7 @@ export async function handleTrackAction( const storedHref = contextMenu?._contextHref; const url = storedHref ? `${window.location.origin}${storedHref}` - : `${window.location.origin}/track/${item.id || item.uuid}`; + : `${window.location.origin}/${type}/${item.id || item.uuid}`; trackOpenInNewTab(type, item.id || item.uuid); window.open(url, '_blank'); @@ -1350,7 +1350,7 @@ export async function handleTrackAction(

Unreleased Track

- +
${item.artists ? `

Artist: ${escapeHtml(Array.isArray(item.artists) ? item.artists.map((a) => a.name || a).join(', ') : item.artists)}

` : ''} ${item.trackerInfo.artist ? `

Tracked Artist: ${escapeHtml(item.trackerInfo.artist)}

` : ''} @@ -1365,7 +1365,7 @@ export async function handleTrackAction( ${item.trackerInfo.leakedDate ? `

Leak Date: ${escapeHtml(new Date(item.trackerInfo.leakedDate).toLocaleDateString())}

` : ''} ${item.trackerInfo.recordingDate ? `

Recording Date: ${escapeHtml(new Date(item.trackerInfo.recordingDate).toLocaleDateString())}

` : ''}
- + ${ item.trackerInfo.description ? ` @@ -1376,7 +1376,7 @@ export async function handleTrackAction( ` : '' } - + ${ item.trackerInfo.notes ? ` @@ -1387,7 +1387,7 @@ export async function handleTrackAction( ` : '' } - + ${ item.trackerInfo.sourceUrl ? ` @@ -1400,7 +1400,7 @@ export async function handleTrackAction( ` : '' } - + ${item.id ? `

Track ID: ${escapeHtml(item.id)}

` : ''} @@ -1429,7 +1429,7 @@ export async function handleTrackAction( ${item.explicit ? `

Explicit: Yes

` : ''}

Quality: ${escapeHtml(quality)} ${bitrate ? `(${escapeHtml(bitrate)})` : ''}

- + ${ item.credits && item.credits.length > 0 ? ` @@ -1442,7 +1442,7 @@ export async function handleTrackAction( ` : '' } - + ${ item.composers && item.composers.length > 0 ? ` @@ -1450,7 +1450,7 @@ export async function handleTrackAction( ` : '' } - + ${ item.lyrics?.text ? ` @@ -1460,7 +1460,7 @@ export async function handleTrackAction( ` : '' } - + ${item.id ? `

Track ID: ${escapeHtml(item.id)}

` : ''} ${item.album?.id ? `

Album ID: ${escapeHtml(item.album.id)}

` : ''}