fix: owned albums wrongly shown as "Unvollständig 1/0" on artist page

Deezer's /artist/{id}/albums list omits nb_tracks, so the album total read as 0 and every
owned album (e.g. N!GHT's "Moonlight"/"Yume") was classified as incomplete "1 / 0 Tracks".

- Web (detail.js): resolve the real Deezer track count via the album endpoint for MATCHED
  (owned) albums only — a couple of calls, not the whole discography — and treat an unknown
  total as complete. Genuine partials still work when the true count is known.
- Android (categorizeAlbums): mark partial only when a known total exceeds what you own;
  unknown total counts as complete (never a false "1 / 0").
- CHANGELOG: documented the fix; corrected the Android lyrics known bug (auto-scroll follows
  playback but isn't smooth — it jumps rather than glides). SW ns-v55.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Opus 4.8 committed 2026-07-31 17:05:14 +02:00
1 parent 5528947a93
commit 640e475c51
4 files changed
+41 -20

No files matched your search

@@ -58,6 +58,9 @@ fun categorizeAlbums(ndAlbums: List<Album>, iAlbums: List<ItunesItem>): ArtistAl
for (ia in uniqueIAlbums) {
val iName = normAlbum(ia.collectionName)
// Deezer's /artist/{id}/albums omits nb_tracks, so trackCount is usually unknown (0) here.
// Only mark "Unvollständig" when we KNOW the album has more tracks than we own — an unknown
// total counts as complete, never a false "1 / 0".
val iCount = ia.trackCount ?: 0
val match = ndAlbums.find { a ->
val n = normAlbum(a.name)
@@ -65,11 +68,11 @@ fun categorizeAlbums(ndAlbums: List<Album>, iAlbums: List<ItunesItem>): ArtistAl
}
when {
match == null -> notDl.add(ia)
iCount > 0 && match.songCount >= iCount -> {
downloaded.add(Pair(match, ia)); usedNdIds.add(match.id)
iCount > match.songCount -> {
partial.add(Triple(match, ia, Pair(match.songCount, iCount))); usedNdIds.add(match.id)
}
else -> {
partial.add(Triple(match, ia, Pair(match.songCount, iCount))); usedNdIds.add(match.id)
downloaded.add(Pair(match, ia)); usedNdIds.add(match.id)
}
}
}