From ef2641c89762526d8e0f7aad5568fd699743157c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20P=C4=99dzich?= Date: Sat, 7 Jan 2023 22:23:17 +0100 Subject: [PATCH] Create snapshot, track, and user models --- src/models/playlist-snapshot.ts | 13 +++++++++++++ src/models/track.ts | 18 ++++++++++++++++++ src/models/user.ts | 4 ++++ 3 files changed, 35 insertions(+) create mode 100644 src/models/playlist-snapshot.ts create mode 100644 src/models/track.ts create mode 100644 src/models/user.ts diff --git a/src/models/playlist-snapshot.ts b/src/models/playlist-snapshot.ts new file mode 100644 index 0000000..0b6fc69 --- /dev/null +++ b/src/models/playlist-snapshot.ts @@ -0,0 +1,13 @@ +import type { User } from './user'; +import type { Track } from './track'; + +export interface PlaylistSnapshot { + description: string; + num_followers: number; + original_name: string; + owner: User; + snapshot_id: string; + tracks: Track[]; + unique_name: string; + url: string; +} diff --git a/src/models/track.ts b/src/models/track.ts new file mode 100644 index 0000000..9552b51 --- /dev/null +++ b/src/models/track.ts @@ -0,0 +1,18 @@ +import type { User } from './user'; + +export interface Track { + added_at: string; + album: { + name: string; + url: string; + }; + artists: User[]; + duration_ms: number; + name: string; + url: string; + date_added: string; + date_added_asterisk: boolean; + date_removed: string | null; + position?: string; + retention?: number; +} diff --git a/src/models/user.ts b/src/models/user.ts new file mode 100644 index 0000000..d8e94be --- /dev/null +++ b/src/models/user.ts @@ -0,0 +1,4 @@ +export interface User { + name: string; + url: string; +}