Skip to content

Add Spotify URL integration with Megaphone API sync #2043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

w3cj
Copy link
Member

@w3cj w3cj commented Jul 14, 2025

Summary

  • Add spotify_id field to Show schema for storing Spotify episode identifiers
  • Implement MegaphoneApiClient for API integration with built-in caching
  • Add comprehensive episode matching using multiple strategies (publish date, title, episode number, position)
  • Create sync functions for individual episodes and batch processing with duplicate prevention
  • Add admin UI for manual Spotify sync with success/error feedback
  • Update ListenLinks to use direct Spotify URLs when available, falling back to search

Test plan

  • Test individual episode sync via admin UI
  • Test batch sync functionality
  • Verify Spotify links work correctly in ListenLinks component
  • Test duplicate prevention logic
  • Verify caching works properly
  • Test error handling for failed API calls

Fixes #2023
Replaces #1667

🤖 Generated with Claude Code

w3cj and others added 2 commits July 14, 2025 09:51
This file provides Claude Code with essential information about the project structure, development commands, and coding conventions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add spotify_id field to Show schema
- Implement MegaphoneApiClient for API integration with caching
- Add comprehensive episode matching using multiple strategies (date, title, number, position)
- Create sync functions for individual episodes and batch processing
- Add admin UI for manual Spotify sync with success/error feedback
- Update ListenLinks to use direct Spotify URLs when available
- Add sync script for bulk Spotify data population
- Consolidate duplicate matching logic into reusable functions
- Remove unnecessary logging while preserving debug capabilities

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link

vercel bot commented Jul 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
syntax-website ✅ Ready (Inspect) Visit Preview Jul 14, 2025 9:59pm

Copy link

codecov bot commented Jul 14, 2025

Bundle Report

Changes will increase total bundle size by 18.29kB (0.06%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
website-client-esm 1.94MB 1.26kB (0.07%) ⬆️
website-server-esm 30.64MB 17.03kB (0.06%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: website-client-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
_app/immutable/entry/app.-bG_xK1J.js (New) 217.88kB 217.88kB 100.0% 🚀
_app/immutable/nodes/39.*.js (New) 39.15kB 39.15kB 100.0% 🚀
_app/immutable/nodes/3._RSj8fn5.js (New) 33.9kB 33.9kB 100.0% 🚀
_app/immutable/nodes/5.CW_lBVNO.js (New) 10.92kB 10.92kB 100.0% 🚀
_app/immutable/chunks/player.CTO39q_9.js (New) 8.39kB 8.39kB 100.0% 🚀
_app/immutable/chunks/HairButton.*.js (New) 8.2kB 8.2kB 100.0% 🚀
_app/immutable/chunks/UserSubmissionForm.*.js (New) 7.45kB 7.45kB 100.0% 🚀
_app/immutable/nodes/33.*.js (New) 5.45kB 5.45kB 100.0% 🚀
_app/immutable/nodes/17.Dp_3dQ5h.js (New) 4.54kB 4.54kB 100.0% 🚀
_app/immutable/chunks/ShareActions.*.js (New) 4.46kB 4.46kB 100.0% 🚀
_app/immutable/nodes/40.87QGG1X_.js (New) 3.14kB 3.14kB 100.0% 🚀
_app/immutable/nodes/25.B-_mZEYy.js (New) 3.01kB 3.01kB 100.0% 🚀
_app/immutable/nodes/44.*.js (New) 2.52kB 2.52kB 100.0% 🚀
_app/immutable/nodes/42.*.js (New) 2.21kB 2.21kB 100.0% 🚀
_app/immutable/nodes/41.*.js (New) 1.45kB 1.45kB 100.0% 🚀
_app/immutable/chunks/Input.BlVziiU_.js (New) 1.36kB 1.36kB 100.0% 🚀
_app/immutable/chunks/PodcastLinks.SMlXxu_0.js (New) 1.2kB 1.2kB 100.0% 🚀
_app/immutable/assets/17.*.css 496 bytes 884 bytes 127.84% ⚠️
_app/immutable/nodes/29.BGa_09Xi.js (New) 855 bytes 855 bytes 100.0% 🚀
_app/immutable/chunks/format_time._o4Ghi47.js (New) 710 bytes 710 bytes 100.0% 🚀
_app/immutable/chunks/slug.*.js (New) 460 bytes 460 bytes 100.0% 🚀
_app/immutable/entry/app.*.js (Deleted) -217.88kB 0 bytes -100.0% 🗑️
_app/immutable/nodes/39.qb4vY_2w.js (Deleted) -39.15kB 0 bytes -100.0% 🗑️
_app/immutable/nodes/3.*.js (Deleted) -33.9kB 0 bytes -100.0% 🗑️
_app/immutable/nodes/5.*.js (Deleted) -10.92kB 0 bytes -100.0% 🗑️
_app/immutable/chunks/player.*.js (Deleted) -8.39kB 0 bytes -100.0% 🗑️
_app/immutable/chunks/HairButton.dsPG_wuG.js (Deleted) -8.2kB 0 bytes -100.0% 🗑️
_app/immutable/chunks/UserSubmissionForm.Nkphu_gR.js (Deleted) -7.45kB 0 bytes -100.0% 🗑️
_app/immutable/nodes/33.D23C_9Rp.js (Deleted) -5.45kB 0 bytes -100.0% 🗑️
_app/immutable/chunks/ShareActions.Di01oS_z.js (Deleted) -4.39kB 0 bytes -100.0% 🗑️
_app/immutable/nodes/17.*.js (Deleted) -3.85kB 0 bytes -100.0% 🗑️
_app/immutable/nodes/40.*.js (Deleted) -3.14kB 0 bytes -100.0% 🗑️
_app/immutable/nodes/25.*.js (Deleted) -3.01kB 0 bytes -100.0% 🗑️
_app/immutable/nodes/44.Qwbf_U_X.js (Deleted) -2.52kB 0 bytes -100.0% 🗑️
_app/immutable/nodes/42.Dx8t_0HV.js (Deleted) -2.21kB 0 bytes -100.0% 🗑️
_app/immutable/nodes/41.Bt-CCTK_.js (Deleted) -1.45kB 0 bytes -100.0% 🗑️
_app/immutable/chunks/Input.*.js (Deleted) -1.36kB 0 bytes -100.0% 🗑️
_app/immutable/chunks/PodcastLinks.*.js (Deleted) -1.2kB 0 bytes -100.0% 🗑️
_app/immutable/nodes/29.*.js (Deleted) -855 bytes 0 bytes -100.0% 🗑️
_app/immutable/chunks/format_time.*.js (Deleted) -710 bytes 0 bytes -100.0% 🗑️
_app/immutable/chunks/slug.Ds_rfLYx.js (Deleted) -460 bytes 0 bytes -100.0% 🗑️

Files in _app/immutable/nodes/17.Dp_3dQ5h.js:

  • ./src/routes/(site)/admin/shows/[show_number]/+page.svelte → Total Size: 3.53kB

Files in _app/immutable/chunks/ShareActions.*.js:

  • ./src/lib/ListenLinks.svelte → Total Size: 1.52kB

App Routes Affected:

App Route Size Change Total Size Change (%)
/(site)/admin/shows/[show_number] 697 bytes 4.54kB 18.12% ⚠️
view changes for bundle: website-server-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
chunks/shows.js 76 bytes 3.11MB 0.0%
chunks/sync.js (New) 13.61kB 13.61kB 100.0% 🚀
entries/pages/(site)/admin/shows/_page.server.ts.js 1.29kB 5.43kB 31.12% ⚠️
entries/pages/(site)/admin/shows/_show_number_/_page.svelte.js 627 bytes 4.89kB 14.72% ⚠️
chunks/ShareActions.js 63 bytes 4.52kB 1.41%
_app/immutable/assets/_page.*.css 496 bytes 884 bytes 127.84% ⚠️
entries/pages/(site)/admin/shows/_show_number_/_page.server.ts.js 871 bytes 2.83kB 44.42% ⚠️

Files in chunks/shows.js:

  • ./src/server/shows.ts → Total Size: 6.12kB

Files in chunks/sync.js:

  • ./src/server/megaphone/sync.ts → Total Size: 8.35kB

  • ./src/server/megaphone/client.ts → Total Size: 4.62kB

Files in entries/pages/(site)/admin/shows/_page.server.ts.js:

  • ./src/routes/(site)/admin/shows/+page.server.ts → Total Size: 64 bytes

Files in entries/pages/(site)/admin/shows/_show_number_/_page.svelte.js:

  • ./src/routes/(site)/admin/shows/[show_number]/+page.svelte → Total Size: 1.99kB

Files in chunks/ShareActions.js:

  • ./src/lib/ListenLinks.svelte → Total Size: 1.13kB

Files in entries/pages/(site)/admin/shows/_show_number_/_page.server.ts.js:

  • ./src/routes/(site)/admin/shows/[show_number]/+page.server.ts → Total Size: 64 bytes

App Routes Affected:

App Route Size Change Total Size Change (%)
/(site)/admin/shows 1.29kB 11.58kB 12.52% ⚠️
/(site)/admin/shows/[show_number] 1.5kB 7.72kB 24.08% ⚠️

Copy link
Collaborator

@stolinski stolinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty straightforward. LGTM. nice stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Episode Spotify Path Incorrect
2 participants