diff --git a/js/events.js b/js/events.js index ee0927a..7d60b6a 100644 --- a/js/events.js +++ b/js/events.js @@ -1633,21 +1633,19 @@ 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(() => { showNotification('Link copied to clipboard!'); }); } else if (action === 'open-in-new-tab') { - // Use stored href from card if available and not a track, otherwise construct URL + // Use stored href from card if available, otherwise construct URL const contextMenu = document.getElementById('context-menu'); const storedHref = contextMenu?._contextHref; - const contextType = contextMenu?._contextType; - const url = - storedHref && contextType !== 'track' - ? `${window.location.origin}${storedHref}` - : `${window.location.origin}/track/${item.id || item.uuid}`; + const url = storedHref + ? `${window.location.origin}${storedHref}` + : `${window.location.origin}/${type}/${item.id || item.uuid}`; trackOpenInNewTab(type, item.id || item.uuid); window.open(url, '_blank'); @@ -1675,7 +1673,7 @@ export async function handleTrackAction(
Unreleased Track
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)}
` : ''} @@ -1690,7 +1688,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())}
` : ''}Track ID: ${escapeHtml(item.id)}
` : ''} @@ -1754,7 +1752,7 @@ export async function handleTrackAction( ${item.explicit ? `Explicit: Yes
` : ''}Quality: ${escapeHtml(quality)} ${bitrate ? `(${escapeHtml(bitrate)})` : ''}
- + ${ item.credits && item.credits.length > 0 ? ` @@ -1767,7 +1765,7 @@ export async function handleTrackAction( ` : '' } - + ${ item.composers && item.composers.length > 0 ? ` @@ -1775,7 +1773,7 @@ export async function handleTrackAction( ` : '' } - + ${ item.lyrics?.text ? ` @@ -1785,7 +1783,7 @@ export async function handleTrackAction( ` : '' } - + ${item.id ? `Track ID: ${escapeHtml(item.id)}
` : ''} ${item.album?.id ? `Album ID: ${escapeHtml(item.album.id)}
` : ''}