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 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.',