From f5a04980a4b83092470cff381b21320001cf8683 Mon Sep 17 00:00:00 2001 From: Pyx <91509874+pyxfluff@users.noreply.github.com> Date: Thu, 29 Aug 2024 23:03:00 -0400 Subject: [PATCH 1/2] Add play count to albums --- .../features/albums/components/album-detail-header.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderer/features/albums/components/album-detail-header.tsx b/src/renderer/features/albums/components/album-detail-header.tsx index 1c59a49e..47387599 100644 --- a/src/renderer/features/albums/components/album-detail-header.tsx +++ b/src/renderer/features/albums/components/album-detail-header.tsx @@ -48,6 +48,10 @@ export const AlbumDetailHeader = forwardRef( value: detailQuery?.data?.duration && formatDurationString(detailQuery.data.duration), }, + { + id: 'playCount', + value: `${detailQuery?.data?.playCount} plays`, + }, ]; if (originalDifferentFromRelease) { From 748db032c751fa5dc20fdc33acacf10f6d226225 Mon Sep 17 00:00:00 2001 From: Kendall Garner <17521368+kgarner7@users.noreply.github.com> Date: Sun, 1 Sep 2024 12:48:11 -0700 Subject: [PATCH 2/2] add translation --- src/i18n/locales/en.json | 2 ++ .../features/albums/components/album-detail-header.tsx | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 949de67b..dfcbe613 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -139,6 +139,8 @@ "genreWithCount_other": "{{count}} genres", "playlist_one": "playlist", "playlist_other": "playlists", + "play_one": "{{count}} play", + "play_other": "{{count}} plays", "playlistWithCount_one": "{{count}} playlist", "playlistWithCount_other": "{{count}} playlists", "smartPlaylist": "smart $t(entity.playlist_one)", diff --git a/src/renderer/features/albums/components/album-detail-header.tsx b/src/renderer/features/albums/components/album-detail-header.tsx index 47387599..9cb017f7 100644 --- a/src/renderer/features/albums/components/album-detail-header.tsx +++ b/src/renderer/features/albums/components/album-detail-header.tsx @@ -50,7 +50,9 @@ export const AlbumDetailHeader = forwardRef( }, { id: 'playCount', - value: `${detailQuery?.data?.playCount} plays`, + value: t('entity.play', { + count: detailQuery?.data?.playCount as number, + }), }, ];