From 3e95518cea67f49187bd3bb3e5d3af83ee863edf Mon Sep 17 00:00:00 2001 From: Phlogi Date: Fri, 22 Aug 2025 21:51:25 +0200 Subject: [PATCH] feature: add link to item in history --- spotizerr-ui/src/routes/history.tsx | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/spotizerr-ui/src/routes/history.tsx b/spotizerr-ui/src/routes/history.tsx index 7effd19..70a69a0 100644 --- a/spotizerr-ui/src/routes/history.tsx +++ b/spotizerr-ui/src/routes/history.tsx @@ -166,18 +166,32 @@ export const History = () => { cell: (info) => { const entry = info.row.original; const isChild = "album_title" in entry; - return isChild ? ( + const historyEntry = entry as HistoryEntry; + const spotifyId = historyEntry.external_ids?.spotify; + const downloadType = historyEntry.download_type; + + const titleContent = isChild ? ( └─ {entry.title} ) : (
{entry.title} - {(entry as HistoryEntry).children_table && ( + {historyEntry.children_table && ( - {(entry as HistoryEntry).total_tracks || "?"} tracks + {historyEntry.total_tracks || "?"} tracks )}
); + + if (!isChild && spotifyId && downloadType) { + return ( + + {titleContent} + + ); + } + + return titleContent; }, }), columnHelper.accessor("artists", {