v4: a playlist's dump count is of the dumps the viewer may see — it counted every dump in the playlist, so a card said "3 dumps" over a page listing two, and told everyone how many private dumps a playlist held. The lists (/playlists, a profile's playlists and followed ones, the search, a dump's playlists, the add-to-playlist panel) now count by isMemberVisibleTo's rule, in SQL as VISIBLE_DUMP_COUNT (lib/playlist-members.ts): the public dumps, and for the owner their own private ones. GET /api/playlists and /api/users/:key/follow/playlists read the optional sign-in for it. The community page and the digests count the public dumps, their figures being the same for every reader. Live, playlist_created and playlist_updated carry each socket's own count: broadcastChange builds the owner's message and the others' apart. playlist_dumps_updated loses its dumpCount, a client counting the dumps it is sent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -423,7 +423,6 @@ describe("Followed feed", () => {
|
||||
type: "playlist_dumps_updated",
|
||||
playlistId: "mix",
|
||||
dumpIds: ["x"],
|
||||
dumpCount: 1,
|
||||
});
|
||||
expect(await screen.findByText("Added to the mix")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
@@ -452,7 +452,6 @@ describe("PlaylistDetail", () => {
|
||||
type: "playlist_dumps_updated",
|
||||
playlistId: "p1",
|
||||
dumpIds: ["a", "c"],
|
||||
dumpCount: 3,
|
||||
});
|
||||
expect(titles()).toEqual(["Alpha", "Charlie"]);
|
||||
socket.receive({
|
||||
@@ -463,7 +462,6 @@ describe("PlaylistDetail", () => {
|
||||
type: "playlist_dumps_updated",
|
||||
playlistId: "p1",
|
||||
dumpIds: ["a", "b", "c"],
|
||||
dumpCount: 3,
|
||||
});
|
||||
expect(await screen.findByText("Bravo")).toBeInTheDocument();
|
||||
expect(titles()).toEqual(["Alpha", "Bravo", "Charlie"]);
|
||||
@@ -522,7 +520,6 @@ describe("PlaylistDetail", () => {
|
||||
type: "playlist_dumps_updated",
|
||||
playlistId: "p1",
|
||||
dumpIds: ["d", "a", "b", "c"],
|
||||
dumpCount: 4,
|
||||
});
|
||||
expect(await screen.findByText("Delta")).toBeInTheDocument();
|
||||
socket.receive({
|
||||
|
||||
Reference in New Issue
Block a user