From 86e6b885557126154abb16a5c85b46961105181a Mon Sep 17 00:00:00 2001 From: Romain VIGNERES <37120461+romainvigneres@users.noreply.github.com> Date: Sat, 28 Mar 2026 02:51:44 +0100 Subject: [PATCH] feat(albums): show grouping tags on album detail page (#1872) * feat(albums): show grouping tags on album detail page --------- Co-authored-by: Romain VIGNERES --- src/i18n/locales/ca.json | 1 + src/i18n/locales/de.json | 1 + src/i18n/locales/en.json | 1 + src/i18n/locales/fr.json | 1 + src/i18n/locales/it.json | 1 + src/i18n/locales/nl.json | 1 + src/i18n/locales/pt-BR.json | 1 + src/i18n/locales/pt.json | 1 + src/i18n/locales/ru.json | 1 + src/i18n/locales/uk.json | 1 + .../components/album-detail-content.tsx | 48 +++++++++++++++++++ 11 files changed, 58 insertions(+) diff --git a/src/i18n/locales/ca.json b/src/i18n/locales/ca.json index 140d8deb4..b666fa9e3 100644 --- a/src/i18n/locales/ca.json +++ b/src/i18n/locales/ca.json @@ -301,6 +301,7 @@ "forward": "endavant", "manage": "gestiona", "mbid": "ID de MusicBrainz", + "grouping": "agrupament", "noResultsFromQuery": "la petició no ha produït resultats", "path": "ruta", "playerMustBePaused": "cal pausar el reproductor", diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index ecc6200e5..48be74f4f 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -124,6 +124,7 @@ "preview": "Vorschau", "reload": "Neu Laden", "mbid": "MusicBrainz ID", + "grouping": "gruppierung", "close": "schließen", "share": "Teilen", "translation": "Übersetzung", diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 467be93b2..99d83c201 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -109,6 +109,7 @@ "minimize": "minimize", "modified": "modified", "mbid": "MusicBrainz ID", + "grouping": "grouping", "mood": "mood", "name": "name", "no": "no", diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index 593a37924..9316e7f98 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -183,6 +183,7 @@ "albumPeak": "crête de l'album", "close": "fermer", "mbid": "Identifiant MusicBrainz", + "grouping": "regroupement", "preview": "aperçu", "share": "partager", "reload": "recharger", diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json index 65697bd35..e681ad0ae 100644 --- a/src/i18n/locales/it.json +++ b/src/i18n/locales/it.json @@ -128,6 +128,7 @@ "close": "chiudi", "codec": "codec", "mbid": "MusicBrainz ID", + "grouping": "raggruppamento", "preview": "anteprima", "reload": "aggiorna", "share": "condividi", diff --git a/src/i18n/locales/nl.json b/src/i18n/locales/nl.json index 32a5e16ed..ac448e606 100644 --- a/src/i18n/locales/nl.json +++ b/src/i18n/locales/nl.json @@ -134,6 +134,7 @@ "bitDepth": "bitdiepte", "codec": "codec", "mbid": "MusicBrainz ID", + "grouping": "groepering", "share": "deel", "explicit": "expliciet", "sampleRate": "sample rate", diff --git a/src/i18n/locales/pt-BR.json b/src/i18n/locales/pt-BR.json index 39a1fb69c..40900507d 100644 --- a/src/i18n/locales/pt-BR.json +++ b/src/i18n/locales/pt-BR.json @@ -84,6 +84,7 @@ "size": "tamanho", "note": "observação", "mbid": "ID no MusicBrainz", + "grouping": "agrupamento", "reload": "recarregar", "codec": "codec", "preview": "pré-visualizar", diff --git a/src/i18n/locales/pt.json b/src/i18n/locales/pt.json index 1f49d1956..ca49f03b6 100644 --- a/src/i18n/locales/pt.json +++ b/src/i18n/locales/pt.json @@ -72,6 +72,7 @@ "forceRestartRequired": "reinicie para aplicar as alterações… feche a notificação para reiniciar", "forward": "para frente", "gap": "intervalo", + "grouping": "agrupamento", "home": "início", "increase": "incrementar", "left": "esquerda", diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index 151bf6c46..77a4cd0e1 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -126,6 +126,7 @@ "note": "заметка", "none": "нет", "mbid": "MusicBrainz ID", + "grouping": "группировка", "reload": "перезагрузить", "preview": "просмотр", "codec": "кодек", diff --git a/src/i18n/locales/uk.json b/src/i18n/locales/uk.json index 5f7d3089f..4f6c01103 100644 --- a/src/i18n/locales/uk.json +++ b/src/i18n/locales/uk.json @@ -98,6 +98,7 @@ "forceRestartRequired": "перезапустіть, щоб застосувати зміни… закрийте повідомлення, щоб перезапустити", "forward": "уперед", "gap": "прогалина", + "grouping": "групування", "home": "додому", "increase": "збільшити", "left": "ліво", diff --git a/src/renderer/features/albums/components/album-detail-content.tsx b/src/renderer/features/albums/components/album-detail-content.tsx index 82a82f09c..a1e9a6b5f 100644 --- a/src/renderer/features/albums/components/album-detail-content.tsx +++ b/src/renderer/features/albums/components/album-detail-content.tsx @@ -94,6 +94,7 @@ interface AlbumMetadataTagsProps { } const MOOD_TAG = 'mood'; +const GROUPING_TAG = 'grouping'; const RELEASE_COUNTRY_TAG = 'releasecountry'; const RELEASE_STATUS_TAG = 'releasestatus'; @@ -155,6 +156,30 @@ const AlbumMetadataTags = ({ album }: AlbumMetadataTagsProps) => { })); }, [album]); + const groupingItems = useMemo(() => { + if (!album) return []; + + return ( + album.tags?.[GROUPING_TAG]?.map((tag) => { + if (album._serverType !== ServerType.NAVIDROME) { + return { id: tag, label: tag, url: null }; + } + + const searchParams = new URLSearchParams(); + const paramsWithCustom = setJsonSearchParam( + searchParams, + FILTER_KEYS.ALBUM._CUSTOM, + { grouping: [tag] }, + ); + return { + id: tag, + label: tag, + url: `${AppRoute.LIBRARY_ALBUMS}?${paramsWithCustom.toString()}`, + }; + }) ?? [] + ); + }, [album]); + const recordLabels = useMemo(() => { if (!album?.recordLabels || album.recordLabels.length === 0) return []; @@ -221,6 +246,29 @@ const AlbumMetadataTags = ({ album }: AlbumMetadataTagsProps) => { items={moodTagItems} title={t('common.mood', { postProcess: 'sentenceCase' })} /> + + {groupingItems.length > 0 && ( + + + {t('common.grouping', { postProcess: 'sentenceCase' })} + +
+ + {groupingItems.map((item) => + item.url ? ( + + {item.label} + + ) : ( + + {item.label} + + ), + )} + +
+
+ )} ); };