Draft
Conversation
The new spotify_graphql pipeline (openpodcast/pipelines#118) sends 14 endpoint names that the existing SpotifyConnector does not recognise, causing every request to fail with HTTP 400 "Unknown endpoint in meta". This commit wires up all 14 endpoints end-to-end. New endpoints accepted ---------------------- Show-level (no episode in meta): showSpotifyStats, showDemographicsStats, showAudienceDiscovery, showGeoStats, showPlatformStats, showImpressionsTrend, showImpressionsSources, showTopEpisodes Episode-level (episode URI in meta): episodeMetadata (GraphQL shape), episodePerformanceAllTime, episodeStreamsAndDownloads, episodePlaysDaily, episodeConsumptionAllTime, episodeAudienceSizeAllTime Storage strategy ---------------- All 14 new endpoints share a single storeGraphQLRaw() method (SpotifyRepository) which inserts into the new spotifyGraphQLRaw table (migration 19). The raw GraphQL response blob is stored as JSON with account_id, show_uri, episode_uri (nullable), endpoint name, and retrieved_at. This keeps the connector side simple while the nested GraphQL shapes get normalised in a follow-up. The existing episodeMetadata handler is unchanged for the old flat payload shape. It detects the new GraphQL shape by the presence of the episodeByUri key and routes to storeGraphQLRaw instead. All old endpoint names (metadata, detailedStreams, listeners, aggregate, followers, performance, impressions_*) are completely untouched. Changed files ------------- src/api/connectors/SpotifyConnector.ts — 14 new else-if branches src/db/SpotifyRepository.ts — storeGraphQLRaw() method src/types/provider/spotify.ts — SpotifyGraphQLPayload types src/types/connector.ts — retrieved + version fields db_schema/migrations/19_spotify_graphql_raw.sql — new table src/schema/spotify/<14 new .json> — permissive JSON schemas fixtures/spotifyGraphql<14 new .json> — real sample data from Leaders Talk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
spotify_graphqlpipeline (openpodcast/pipelines#118) is a GraphQL-basedreplacement for both the old
spotify/andanchor/pipelines, which bothuse broken REST connectors.