mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
fix(statistics): accurate counts for large libraries + album-artist tooltip
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 <noreply@anthropic.com>
This commit is contained in:
+4
-9
@@ -631,11 +631,10 @@ export async function fetchStatisticsLibraryAggregates(): Promise<StatisticsLibr
|
||||
let songsCounted = 0;
|
||||
const genreAgg = new Map<string, { songCount: number; albumCount: number }>();
|
||||
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<StatisticsLibr
|
||||
g.albumCount += 1;
|
||||
}
|
||||
if (albums.length < pageSize) break;
|
||||
if (page === maxPages - 1) {
|
||||
capped = true;
|
||||
break;
|
||||
}
|
||||
offset += pageSize;
|
||||
nextPage = getAlbumList('newest', pageSize, offset);
|
||||
nextPage = getAlbumList('alphabeticalByName', pageSize, offset);
|
||||
} catch {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user