feat(most-played): add dedicated Most Played page (#86)

New sidebar item (TrendingUp icon, /most-played route) with:

- Top Artists section: derived by grouping frequent albums by artistId
  and summing playCount — no extra API calls needed. Shows up to 10
  artists as a responsive grid with avatar, rank and total play count.
- Top Albums section: paginated list using getAlbumList('frequent'),
  50 albums per batch with a "Load more" button. Each row shows rank,
  cover thumbnail (44px), album name, artist (navigates to artist
  page), year and play count.
- Sort toggle (most plays first / fewest plays first).

Also adds playCount?: number to SubsonicAlbum — Navidrome returns this
field in getAlbumList2?type=frequent but it was missing from the type.

Closes #86

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Psychotoxical
2026-04-07 20:00:07 +02:00
parent 9319c40fde
commit 4b8b6ae797
13 changed files with 477 additions and 5 deletions
+11
View File
@@ -19,6 +19,7 @@ export const deTranslation = {
offlineLibrary: 'Offline-Bibliothek',
genres: 'Genres',
playlists: 'Playlists',
mostPlayed: 'Meistgehört',
radio: 'Internetradio',
libraryScope: 'Bibliotheksumfang',
allLibraries: 'Alle Bibliotheken',
@@ -777,6 +778,16 @@ export const deTranslation = {
metaSaved: 'Playlist aktualisiert',
downloadZip: 'Herunterladen (ZIP)',
},
mostPlayed: {
title: 'Meistgehört',
topArtists: 'Top-Künstler',
topAlbums: 'Top-Alben',
plays: '{{n}}× gespielt',
sortMost: 'Meiste Plays zuerst',
sortLeast: 'Wenigste Plays zuerst',
loadMore: 'Mehr Alben laden',
noData: 'Noch keine Wiedergabedaten. Fang an zu hören!',
},
radio: {
title: 'Internetradio',
empty: 'Keine Radiosender konfiguriert.',
+11
View File
@@ -20,6 +20,7 @@ export const enTranslation = {
offlineLibrary: 'Offline Library',
genres: 'Genres',
playlists: 'Playlists',
mostPlayed: 'Most Played',
radio: 'Internet Radio',
libraryScope: 'Library scope',
allLibraries: 'All libraries',
@@ -778,6 +779,16 @@ export const enTranslation = {
metaSaved: 'Playlist updated',
downloadZip: 'Download (ZIP)',
},
mostPlayed: {
title: 'Most Played',
topArtists: 'Top Artists',
topAlbums: 'Top Albums',
plays: '{{n}} plays',
sortMost: 'Most plays first',
sortLeast: 'Fewest plays first',
loadMore: 'Load more albums',
noData: 'No play data yet. Start listening!',
},
radio: {
title: 'Internet Radio',
empty: 'No radio stations configured.',
+11
View File
@@ -19,6 +19,7 @@ export const frTranslation = {
offlineLibrary: 'Bibliothèque hors ligne',
genres: 'Genres',
playlists: 'Playlists',
mostPlayed: 'Les plus joués',
radio: 'Radio Internet',
libraryScope: 'Portée de la bibliothèque',
allLibraries: 'Toutes les bibliothèques',
@@ -777,6 +778,16 @@ export const frTranslation = {
metaSaved: 'Playlist mise à jour',
downloadZip: 'Télécharger (ZIP)',
},
mostPlayed: {
title: 'Les plus joués',
topArtists: 'Artistes populaires',
topAlbums: 'Albums populaires',
plays: '{{n}} écoutes',
sortMost: 'Plus joués en premier',
sortLeast: 'Moins joués en premier',
loadMore: 'Charger plus d\'albums',
noData: 'Aucune donnée d\'écoute. Commencez à écouter !',
},
radio: {
title: 'Radio Internet',
empty: 'Aucune station radio configurée.',
+11
View File
@@ -19,6 +19,7 @@ export const nbTranslation = {
offlineLibrary: 'Frakoblet bibliotek',
genres: 'Sjangere',
playlists: 'Spillelister',
mostPlayed: 'Mest spilt',
radio: 'Internettradio',
libraryScope: 'Biblioteksomfang',
allLibraries: 'Alle biblioteker',
@@ -776,6 +777,16 @@ export const nbTranslation = {
metaSaved: 'Spillelisten er oppdatert',
downloadZip: 'Last ned (ZIP)',
},
mostPlayed: {
title: 'Mest spilt',
topArtists: 'Toppkunstnere',
topAlbums: 'Toppalbum',
plays: '{{n}} avspillinger',
sortMost: 'Mest spilt først',
sortLeast: 'Minst spilt først',
loadMore: 'Last inn flere album',
noData: 'Ingen avspillingsdata ennå. Begynn å høre!',
},
radio: {
title: 'Internettradio',
empty: 'Ingen radiostasjoner konfigurert.',
+11
View File
@@ -19,6 +19,7 @@ export const nlTranslation = {
offlineLibrary: 'Offline bibliotheek',
genres: 'Genres',
playlists: 'Playlists',
mostPlayed: 'Meest gespeeld',
radio: 'Internetradio',
libraryScope: 'Bibliotheekbereik',
allLibraries: 'Alle bibliotheken',
@@ -777,6 +778,16 @@ export const nlTranslation = {
metaSaved: 'Playlist bijgewerkt',
downloadZip: 'Downloaden (ZIP)',
},
mostPlayed: {
title: 'Meest gespeeld',
topArtists: 'Topkunstenaars',
topAlbums: 'Topalbums',
plays: '{{n}} keer gespeeld',
sortMost: 'Meest gespeeld eerst',
sortLeast: 'Minst gespeeld eerst',
loadMore: 'Meer albums laden',
noData: 'Nog geen afspeelgegevens. Begin met luisteren!',
},
radio: {
title: 'Internetradio',
empty: 'Geen radiostations geconfigureerd.',
+11
View File
@@ -20,6 +20,7 @@ export const ruTranslation = {
offlineLibrary: 'Офлайн-библиотека',
genres: 'Жанры',
playlists: 'Плейлисты',
mostPlayed: 'Часто слушаемое',
radio: 'Онлайн-радио',
libraryScope: 'Область медиатеки',
allLibraries: 'Все библиотеки',
@@ -831,6 +832,16 @@ export const ruTranslation = {
metaSaved: 'Плейлист сохранён',
downloadZip: 'Скачать (ZIP)',
},
mostPlayed: {
title: 'Часто слушаемое',
topArtists: 'Топ исполнителей',
topAlbums: 'Топ альбомов',
plays: '{{n}} прослушиваний',
sortMost: 'Сначала популярные',
sortLeast: 'Сначала малоизвестные',
loadMore: 'Загрузить больше альбомов',
noData: 'Нет данных о прослушиваниях. Начните слушать!',
},
radio: {
title: 'Онлайн-радио',
empty: 'Радиостанции не настроены.',
+11
View File
@@ -19,6 +19,7 @@ export const zhTranslation = {
offlineLibrary: '离线音乐库',
genres: '流派',
playlists: '播放列表',
mostPlayed: '最常播放',
radio: '网络电台',
libraryScope: '资料库范围',
allLibraries: '所有资料库',
@@ -773,6 +774,16 @@ export const zhTranslation = {
metaSaved: '播放列表已更新',
downloadZip: '下载 (ZIP)',
},
mostPlayed: {
title: '最常播放',
topArtists: '热门艺术家',
topAlbums: '热门专辑',
plays: '播放 {{n}} 次',
sortMost: '最多播放在前',
sortLeast: '最少播放在前',
loadMore: '加载更多专辑',
noData: '暂无播放数据,开始聆听吧!',
},
radio: {
title: '网络电台',
empty: '未配置任何电台。',