feat(web/m7-352): Playlist type gains kind/system_variant/seed_artist_id fields

This commit is contained in:
2026-05-04 18:14:46 -04:00
parent a8630a1355
commit 56f0998f84
5 changed files with 17 additions and 2 deletions
+3
View File
@@ -58,6 +58,9 @@ export type Playlist = {
name: string;
description: string;
is_public: boolean;
kind: 'user' | 'system';
system_variant: 'for_you' | 'songs_like_artist' | null;
seed_artist_id: string | null;
cover_url: string; // empty string when no cover; UI renders glyph
track_count: number;
duration_sec: number;
@@ -12,6 +12,9 @@ const playlistsData = vi.hoisted(() => ({
name: 'B-list',
description: '',
is_public: false,
kind: 'user',
system_variant: null,
seed_artist_id: null,
cover_url: '',
track_count: 3,
duration_sec: 0,
@@ -25,6 +28,9 @@ const playlistsData = vi.hoisted(() => ({
name: 'A-list',
description: '',
is_public: false,
kind: 'user',
system_variant: null,
seed_artist_id: null,
cover_url: '',
track_count: 5,
duration_sec: 0,
@@ -58,6 +64,9 @@ vi.mock('$lib/api/playlists', () => ({
name: 'New',
description: '',
is_public: false,
kind: 'user',
system_variant: null,
seed_artist_id: null,
cover_url: '',
track_count: 0,
duration_sec: 0,
@@ -16,6 +16,9 @@ const base: Playlist = {
name: 'Saturday morning',
description: '',
is_public: false,
kind: 'user',
system_variant: null,
seed_artist_id: null,
cover_url: '',
track_count: 12,
duration_sec: 0,
@@ -56,7 +56,7 @@ const mockedQuery = createPlaylistQuery as ReturnType<typeof vi.fn>;
const ownDetail: PlaylistDetail = {
id: 'p1', user_id: 'u-self', owner_username: 'me', name: 'Mine',
description: '', is_public: false, cover_url: '', track_count: 2, duration_sec: 274,
description: '', is_public: false, kind: 'user', system_variant: null, seed_artist_id: null, cover_url: '', track_count: 2, duration_sec: 274,
created_at: '', updated_at: '',
tracks: [
{ position: 0, track_id: 't1', album_id: 'a1', artist_id: 'ar1', title: 'A', artist_name: 'X', album_title: 'Y', duration_sec: 137, stream_url: '/api/tracks/t1/stream', added_at: '' },
+1 -1
View File
@@ -27,7 +27,7 @@ const mockedCreatePlaylist = createPlaylist as ReturnType<typeof vi.fn>;
function p(over: Partial<Playlist>): Playlist {
return {
id: 'p1', user_id: 'u-self', owner_username: 'me', name: 'A',
description: '', is_public: false, cover_url: '', track_count: 0, duration_sec: 0,
description: '', is_public: false, kind: 'user', system_variant: null, seed_artist_id: null, cover_url: '', track_count: 0, duration_sec: 0,
created_at: '', updated_at: '', ...over
};
}