Improve transcoding error handling and update type definitions - #7
Conversation
Co-authored-by: Harshal Sawant <109863197+harusharu@users.noreply.github.com>
Co-authored-by: Harshal Sawant <109863197+harusharu@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: Harshal Sawant <109863197+harusharu@users.noreply.github.com>
Co-authored-by: Harshal Sawant <109863197+harusharu@users.noreply.github.com>
…actor Results component to group by provider; update SettingsView layout Co-authored-by: Harshal Sawant <109863197+harusharu@users.noreply.github.com>
…ovider catalog updates Co-authored-by: Harshal Sawant <109863197+harusharu@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR shifts discovery (home feed + search) from single-provider browsing to an aggregated “all providers” catalog, while enriching Media with provider metadata so the UI can attribute results to sources. It also improves the robustness of the MediaSource (transcode) playback path and refreshes several UI surfaces (settings, cards, modals, global background styling).
Changes:
- Aggregate featured + search results across all live providers and annotate
Mediaitems with provider metadata. - Improve MSE/transcode playback lifecycle handling (buffer events, reader cancellation, end-of-stream gating) and add a safer transcode planning failure path.
- UI/layout refresh across home/search/settings/player, plus global background/selection styling.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/media/streamProxy.ts | Simplifies HLS manifest rewriting so non-comment URI lines are consistently resolved/proxied. |
| src/lib/hooks/useProviders.ts | Adds abortable provider refreshes and avoids redundant provider list updates via a signature. |
| src/lib/hooks/useMseStream.ts | Improves MSE cleanup/error handling (reader cancel, buffer listeners, end-of-stream gating). |
| src/lib/api/types.ts | Extends Media schema with provider identity + multi-provider attribution fields. |
| src/lib/api/client.ts | Adds multi-provider featured/search fan-out, per-item annotation, and merge/deduping helpers. |
| src/components/layout/Header.tsx | Removes the active-provider pill UI from the header. |
| src/components/layout/App.tsx | Switches home/search to multi-provider discovery and updates provider selection behavior for meta/playback calls. |
| src/components/features/settings/SettingsView.tsx | Reworks settings layout and adds provider refresh affordance + “source strategy” explainer. |
| src/components/features/search/Results.tsx | Groups rendered results by provider attribution for clearer provenance. |
| src/components/features/player/PlayerModal.tsx | Adjusts player UX and error recovery; simplifies controls; tweaks stream classification inputs. |
| src/components/features/player/DetailModal.tsx | Updates modal layout/styling. |
| src/components/features/home/Rail.tsx | Adjusts rail spacing/styling for the refreshed home layout. |
| src/components/features/home/Hero.tsx | Updates hero styling/gradients to match the new visual design. |
| src/components/features/home/Card.tsx | Adds provider badge/year parsing and refreshes card UI styling/content layout. |
| src/app/globals.css | Adds global background gradient styling and selection colors. |
| src/app/api/play/route.ts | Adds explicit try/catch around transcode planning with improved logging and a 502 response on failure. |
Suppressed comments (2)
src/components/features/player/PlayerModal.tsx:400
autoAdvanceis hard-coded totrue, so the user’ssettings.autoAdvancepreference (still exposed in Settings) no longer has any effect. Wire the setting back throughApp→PlayerModal→PlayerBridgeso the toggle actually controls episode auto-advance.
<PlayerBridge
kind={kind}
source={source}
savedPosition={savedPosition}
rate={rate}
setRate={setRate}
autoAdvance={true}
stalledMessage={stalledMessage}
setStalledMessage={setStalledMessage}
src/components/layout/App.tsx:216
- Same issue as
onOpen: usingitem.providerId ?? settings.providerwill ignore the preferred provider wheneverproviderIdis present. Prefersettings.providerwhen it’s listed initem.providerIdsso playback/metadata resolution follows the configured ordering.
try {
const meta = await getMeta(item.link, item.providerId ?? settings.provider);
if (session !== playerSessionRef.current) return;
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const signature = body.providers | ||
| .map((provider) => `${provider.id}:${provider.name}`) | ||
| .join('|'); | ||
| if (signature !== lastSignatureRef.current) { | ||
| lastSignatureRef.current = signature; | ||
| setProviders(body.providers); | ||
| setAvailableProviders(body.providers); | ||
| } |
| // Which renderer serves the current source: HLS via Vidstack's internal | ||
| // hls.js, a natively playable MP4, or the ffmpeg transcode proxy (MKV et al.). | ||
| const kind = classifySource(source ?? '', sourceType); | ||
| const kind = classifySource(source ?? '', undefined); | ||
|
|
| try { | ||
| const meta = await getMeta(item.link, settings.provider); | ||
| const meta = await getMeta(item.link, item.providerId ?? settings.provider); |
v0 Session