android: the whole discography, on a page of its own
The artist page already filed every release the desktop's way, but it only ever showed one category at a time and it showed all of it: no slice anywhere in that grid, so an artist with 140 releases drew 140 cards. There is a page now — All in front of the categories, a sort, a grouping by year, and the editions opened in place under their own record, which is the part a flat list loses — and the grid behind it stops at twelve with the way down under it. It is the same classifier twice over the same cached albums, which the desktop cannot do because its filing waits on a background description harvest; the three things its own page has and this one does not — a tracklist per record, an accent sampled per cover, the scroll-led banner — are 140 calls and 140 decodes over mobile data for rows that are one tap away, and ANDROID.md says so rather than leaving them looking forgotten. The list caps at sixty with the rest a button away, before the grouping, so the last year on screen can be a part of itself; under a name order By year is not offered, because the years would repeat out of sequence. The mock gains a 140-record artist so both caps are walked rather than argued about.
This commit is contained in:
1 parent
1258b2b78d
commit
f2cde4ec7c
9 files changed
+491
-12
No files matched your search
+24
-4
@@ -635,13 +635,33 @@ const SLOW_ALBUMS = [
|
||||
{ id: 4155, title: "Long Winter", release_date: "2023-01-20", record_type: "album", track_count: 10 },
|
||||
{ id: 4156, title: "Open Water", release_date: "2024-08-30", record_type: "album", track_count: 11 },
|
||||
].map((a) => ({ ...a, artist: CAT_SLOW.name, cover: svgArt((a.id * 17) % 360, a.title[0]), edition_group: null, is_soundtrack: false }));
|
||||
/* A prolific artist, so the discography page's cap is WALKED rather than
|
||||
argued about: 140 records, four a year from 1985, each plainly titled for
|
||||
the same reason SLOW_ALBUMS' are — the classifier must leave every one of
|
||||
them on the Albums tab, or the counts the walk asserts stop meaning
|
||||
anything. Deliberately NOT in RELATED: a fifth card in the rail would move
|
||||
the artist page's own card census (cat-artist-tab counts 2 images and 2
|
||||
placeholders there). The walk reaches it with a seed, so no search
|
||||
answers for it either. */
|
||||
const CAT_BIG = { id: 416, name: "Ember Parade", picture: null, album_count: 140, fans: 91000 };
|
||||
const BIG_ALBUMS = Array.from({ length: 140 }, (_, i) => ({
|
||||
id: 41600 + i,
|
||||
title: "Field Notes " + (i + 1),
|
||||
artist: CAT_BIG.name,
|
||||
cover: svgArt((i * 37) % 360, "F"),
|
||||
release_date: (1985 + Math.floor(i / 4)) + "-" + String((i % 4) * 3 + 2).padStart(2, "0") + "-15",
|
||||
record_type: "album",
|
||||
track_count: 8 + (i % 5),
|
||||
edition_group: null,
|
||||
is_soundtrack: false,
|
||||
}));
|
||||
/* the heroes chosen this session — pick_image → set_artist_hero */
|
||||
const heroes = {};
|
||||
let follows = [];
|
||||
function mockCatalog(cmd, args) {
|
||||
if (cmd === "catalog_artist") {
|
||||
const id = Number(args?.artistId);
|
||||
const a = id === CAT_ARTIST.id ? CAT_ARTIST : id === CAT_SLOW.id ? CAT_SLOW : RELATED.find((r) => r.id === id);
|
||||
const a = id === CAT_ARTIST.id ? CAT_ARTIST : id === CAT_SLOW.id ? CAT_SLOW : id === CAT_BIG.id ? CAT_BIG : RELATED.find((r) => r.id === id);
|
||||
if (!a) return Promise.reject(new Error("catalog_artist: unknown artist"));
|
||||
const own = a === CAT_ARTIST;
|
||||
/* the exhaustive page, kept four seconds on purpose: whatever is on
|
||||
@@ -650,7 +670,7 @@ function mockCatalog(cmd, args) {
|
||||
return new Promise((r) => setTimeout(() => r({
|
||||
artist: a, banner: heroes[a.id] ?? null, banners: heroes[a.id] ? [heroes[a.id]] : [], banner_custom: !!heroes[a.id], logos: [],
|
||||
popular_tracks: own ? CAT_TRACKS.slice(0, 7).map((t, i) => ({ ...t, listeners: 2_400_000 - i * 310_000 })) : [],
|
||||
albums: own ? CAT_DISCO : slow ? SLOW_ALBUMS : [{ id: 900 + id, title: a.name + " Live", artist: a.name, cover: null, release_date: "2015-01-01", record_type: "album", track_count: 9, edition_group: null, is_soundtrack: false }],
|
||||
albums: own ? CAT_DISCO : slow ? SLOW_ALBUMS : a === CAT_BIG ? BIG_ALBUMS : [{ id: 900 + id, title: a.name + " Live", artist: a.name, cover: null, release_date: "2015-01-01", record_type: "album", track_count: 9, edition_group: null, is_soundtrack: false }],
|
||||
top_genre: "Electronic", socials: [],
|
||||
}), slow ? 4000 : 220));
|
||||
}
|
||||
@@ -746,9 +766,9 @@ function mockCatalog(cmd, args) {
|
||||
so `artist.id` must equal the argument or the wrapper throws */
|
||||
if (cmd === "catalog_artist_overview") {
|
||||
const id = Number(args?.artistId);
|
||||
const a = id === CAT_ARTIST.id ? CAT_ARTIST : id === CAT_SLOW.id ? CAT_SLOW : RELATED.find((r) => r.id === id);
|
||||
const a = id === CAT_ARTIST.id ? CAT_ARTIST : id === CAT_SLOW.id ? CAT_SLOW : id === CAT_BIG.id ? CAT_BIG : RELATED.find((r) => r.id === id);
|
||||
if (!a) return Promise.reject(new Error("catalog_artist_overview: unknown artist"));
|
||||
const albums = id === CAT_SLOW.id ? SLOW_ALBUMS.slice(0, 4) : id === CAT_ARTIST.id ? CAT_DISCO.slice(0, 4) : [];
|
||||
const albums = id === CAT_SLOW.id ? SLOW_ALBUMS.slice(0, 4) : id === CAT_ARTIST.id ? CAT_DISCO.slice(0, 4) : id === CAT_BIG.id ? BIG_ALBUMS.slice(0, 4) : [];
|
||||
return new Promise((r) => setTimeout(() => r({ artist: a, popular_tracks: [], albums }), 300));
|
||||
}
|
||||
if (cmd === "catalog_art") return Promise.resolve(svgArt(200, "D"));
|
||||
|
||||
Reference in new issue
Block a user