From 8f45f7230e803622d31b7fed9a6978f7fd1003ea Mon Sep 17 00:00:00 2001 From: Psychotoxical Date: Sun, 12 Apr 2026 11:47:41 +0200 Subject: [PATCH] fix(statistics): accurate counts for large libraries + album-artist tooltip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the 10-page cap in fetchStatisticsLibraryAggregates — the loop now runs until the server returns a partial page, so albums/songs/playtime reflect the full library regardless of size (previously capped at 5,000 albums). Switched sort type from 'newest' to 'alphabeticalByName' for a stable pagination order. Add a tooltip on the Artists stat card explaining it shows album artists only (Subsonic API limitation — track-level featured/guest artists without their own album are not included). Tooltip added in all 8 locales. Labels with a tooltip get a dotted underline and cursor:help as visual hint. Co-Authored-By: Claude Sonnet 4.6 --- src/api/subsonic.ts | 13 ++++--------- src/locales/de.ts | 1 + src/locales/en.ts | 1 + src/locales/es.ts | 1 + src/locales/fr.ts | 1 + src/locales/nb.ts | 1 + src/locales/nl.ts | 1 + src/locales/ru.ts | 1 + src/locales/zh.ts | 1 + src/pages/Statistics.tsx | 4 ++-- src/styles/components.css | 7 +++++++ 11 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/api/subsonic.ts b/src/api/subsonic.ts index f9286c5d..863f03ae 100644 --- a/src/api/subsonic.ts +++ b/src/api/subsonic.ts @@ -631,11 +631,10 @@ export async function fetchStatisticsLibraryAggregates(): Promise(); const pageSize = 500; - const maxPages = 10; - let capped = false; + const capped = false; let offset = 0; - let nextPage = getAlbumList('newest', pageSize, 0); - for (let page = 0; page < maxPages; page++) { + let nextPage = getAlbumList('alphabeticalByName', pageSize, 0); + for (;;) { try { const albums = await nextPage; for (const a of albums) { @@ -653,12 +652,8 @@ export async function fetchStatisticsLibraryAggregates(): Promise (
{s.value} - {s.label} + {s.label}
))} diff --git a/src/styles/components.css b/src/styles/components.css index 1433aef3..93aa0622 100644 --- a/src/styles/components.css +++ b/src/styles/components.css @@ -3982,6 +3982,13 @@ html.no-compositing .fs-lyrics-rail { color: var(--text-muted); } +.stats-card-label[data-tooltip] { + cursor: help; + text-decoration: underline; + text-decoration-style: dotted; + text-underline-offset: 3px; +} + /* Genre chart */ .genre-chart { background: var(--bg-card);