From a095c2da4591eac3ce18f2aa3a2637acfeabe051 Mon Sep 17 00:00:00 2001 From: Reuben Frankel Date: Tue, 15 Oct 2024 14:20:35 +0100 Subject: [PATCH 1/2] Add playlist track schema to cover missing boolean properties `episode` and `track` --- tap_spotify/schemas/track.py | 6 ++++++ tap_spotify/streams.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tap_spotify/schemas/track.py b/tap_spotify/schemas/track.py index 0b89970..d803189 100644 --- a/tap_spotify/schemas/track.py +++ b/tap_spotify/schemas/track.py @@ -29,3 +29,9 @@ th.Property("type", th.StringType), th.Property("uri", th.StringType), ) + +PlaylistTrackObject = th.PropertiesList( + *TrackObject, + th.Property("episode", th.BooleanType), + th.Property("track", th.BooleanType), +) diff --git a/tap_spotify/streams.py b/tap_spotify/streams.py index cdbd0c8..06100ff 100644 --- a/tap_spotify/streams.py +++ b/tap_spotify/streams.py @@ -12,7 +12,7 @@ from tap_spotify.client import SpotifyStream from tap_spotify.schemas.artist import ArtistObject from tap_spotify.schemas.audio_features import AudioFeaturesObject -from tap_spotify.schemas.track import TrackObject +from tap_spotify.schemas.track import PlaylistTrackObject, TrackObject from tap_spotify.schemas.utils.rank import Rank from tap_spotify.schemas.utils.synced_at import SyncedAt @@ -197,7 +197,7 @@ class _PlaylistTracksStream(_RankStream, _SyncedAtStream, _TracksStream): records_jsonpath = "$.tracks.items[*].track" schema = th.PropertiesList( - *TrackObject, + *PlaylistTrackObject, *AudioFeaturesObject, *Rank, *SyncedAt, From f622a413201034424929d4649813ff3eaefa0028 Mon Sep 17 00:00:00 2001 From: Reuben Frankel Date: Tue, 15 Oct 2024 15:03:41 +0100 Subject: [PATCH 2/2] Missing album schema property `is_playable` (only seems to be present in tracks from `user_saved_tracks_stream`) --- tap_spotify/schemas/album.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tap_spotify/schemas/album.py b/tap_spotify/schemas/album.py index 7bed0be..90f8318 100644 --- a/tap_spotify/schemas/album.py +++ b/tap_spotify/schemas/album.py @@ -15,6 +15,7 @@ th.Property("href", th.StringType), th.Property("id", th.StringType), th.Property("images", th.ArrayType(ImageObject)), + th.Property("is_playable", th.BooleanType), th.Property("name", th.StringType), th.Property("release_date", th.StringType), th.Property("release_date_precision", th.StringType),