From bff48ad21cb506de63050c69bc50c15848ee6c1b Mon Sep 17 00:00:00 2001 From: Julien Maille Date: Fri, 2 Jan 2026 18:03:36 +0100 Subject: [PATCH] IMP: remove heuristic filtering for EPs/Singles, rely on API type --- js/api.js | 3 +-- js/ui.js | 41 ----------------------------------------- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/js/api.js b/js/api.js index fd5e771..23c2e65 100644 --- a/js/api.js +++ b/js/api.js @@ -592,8 +592,7 @@ export class LosslessAPI { const eps = allReleases.filter(a => a.type === 'EP' || - a.type === 'SINGLE' || - (a.numberOfTracks < 7 && !a.type) + a.type === 'SINGLE' ); const albums = allReleases.filter(a => !eps.includes(a)); diff --git a/js/ui.js b/js/ui.js index 2b3240d..27985d3 100644 --- a/js/ui.js +++ b/js/ui.js @@ -161,44 +161,6 @@ export class UIRenderer { `; } - createAlbumCardHTML(album) { - const explicitBadge = hasExplicitContent(album) ? this.createExplicitBadge() : ''; - let yearDisplay = ''; - if (album.releaseDate) { - const date = new Date(album.releaseDate); - if (!isNaN(date.getTime())) { - yearDisplay = `${date.getFullYear()}`; - } - } - - let typeLabel = ''; - if (album.type === 'EP') { - typeLabel = ' • EP'; - } else if (album.type === 'SINGLE') { - typeLabel = ' • Single'; - } else if (!album.type && album.numberOfTracks) { - if (album.numberOfTracks <= 3) typeLabel = ' • Single'; - else if (album.numberOfTracks <= 6) typeLabel = ' • EP'; - } - - return ` -
-
- ${album.title} - - -
-

${album.title} ${explicitBadge}

-

${album.artist?.name ?? ''}

-

${yearDisplay}${typeLabel}

-
- `; - } - createPlaylistCardHTML(playlist) { const imageId = playlist.squareImage || playlist.image || playlist.uuid; // Fallback or use a specific cover getter if needed return ` @@ -300,9 +262,6 @@ export class UIRenderer { typeLabel = ' • EP'; } else if (album.type === 'SINGLE') { typeLabel = ' • Single'; - } else if (!album.type && album.numberOfTracks) { - if (album.numberOfTracks <= 3) typeLabel = ' • Single'; - else if (album.numberOfTracks <= 6) typeLabel = ' • EP'; } return `