Skip to content

Feat/add podcast support - #1

Draft
SteindelSE wants to merge 2 commits into
NuclearPlayer:masterfrom
SteindelSE:feat/add-podcast-support
Draft

Feat/add podcast support#1
SteindelSE wants to merge 2 commits into
NuclearPlayer:masterfrom
SteindelSE:feat/add-podcast-support

Conversation

@SteindelSE

Copy link
Copy Markdown

Summary

Adds podcast support to the SoundCloud plugin for Nuclear's new Podcasts tab.

Implements the four new MetadataProvider methods (searchPodcastChannels, searchPodcastHandles, searchPodcastTitles, fetchPodcastChannelDetails) and declares the new search/metadata capabilities.

SoundCloud podcasters already register as users with kind === 'podcast' (or 'group'), so this implementation reuses the existing search/users, search/tracks, users/:id, and users/:id/tracks endpoints with client-side filtering — no new HTTP calls.

Temporary shim

This PR vendors the new SDK types (PodcastChannel, PodcastChannelRef, PodcastEpisodeRef, PodcastChannelMetadataCapability) in src/podcast-sdk.ts because the host's podcast support is on nukeop/nuclear#feat/add-podcast-support but the corresponding @nuclearplayer/plugin-sdk release is not yet on npm. Once a release that exports these types is published, the shim file can be deleted in a follow-up PR.

Source for the vendored types: nukeop/nuclear@feat/add-podcast-support

  • packages/model/src/podcast.ts
  • packages/plugin-sdk/src/types/{search,metadata}.ts

⚠️ Action required to merge

Once nukeop/nuclear#feat/add-podcast-support lands and the resulting @nuclearplayer/plugin-sdk release is published to npm:

  1. Delete src/podcast-sdk.ts
  2. Update src/metadata-provider.ts to drop the as MetadataProvider cast on the returned provider
  3. Bump @nuclearplayer/plugin-sdk in package.json to the new release
  4. Re-import PodcastChannel* from @nuclearplayer/plugin-sdk

Adds the vendored PodcastChannel/PodcastEpisodeRef/PodcastChannel types
in src/podcast-sdk.ts (temporary, until @nuclearplayer/plugin-sdk ships
them) plus three mappers: mapUserToPodcastChannelRef, mapTrackToPodcastEpisodeRef,
and mapUserToPodcastChannel. All reuse the existing SoundcloudUser/SoundcloudTrack
shapes — no new HTTP calls needed, since SoundCloud podcasters already
register as users with kind === 'podcast' (or 'group').
Implements searchPodcastChannels (filters search/users to kind === 'podcast'
or 'group'), searchPodcastHandles (strips leading '@' and matches on permalink),
searchPodcastTitles (filters search/tracks by podcast user), and
fetchPodcastChannelDetails (getUser + getUserTracks sorted latest-to-oldest).

The provider literal carries the new podcastChannelMetadataCapabilities and
the three podcast search categories. The single 'as MetadataProvider' cast
is unavoidable until @nuclearplayer/plugin-sdk publishes a release that
exports these fields natively — the shim and that cast are the two
follow-up items when the SDK release lands.
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.

2 participants