Skip to content

Fix opening a movie DVR recording's details page - #1969

Open
mackandall wants to merge 1 commit into
damontecres:mainfrom
mackandall:fix/recording-movie-navigation
Open

mackandall wants to merge 1 commit into
damontecres:mainfrom
mackandall:fix/recording-movie-navigation

Conversation

@mackandall

Copy link
Copy Markdown

What

Selecting a DVR recording of a movie (e.g. from the Recorded Movies grid) shows a bare "Unsupported item type: Recording" screen instead of the movie's details page. No crash, just a dead-end text screen.

This equally affects an episode recording opened via its own standalone details destination — it just doesn't surface as often, since browsing an episode inline within its season page uses a different code path that renders its own header directly.

Root cause

BaseItem.destination() converts a BaseItem into a navigation Destination via when (type) { ... }. A DVR recording's own type is always BaseItemKind.RECORDING, regardless of whether the underlying content is a movie or a series episode — there was no RECORDING case, so it fell into else -> Destination.MediaItem(this), which carries type = RECORDING straight through. DestinationContent.kt's own dispatch when (destination.type) has cases for SERIES, MOVIE, EPISODE, etc., but none for RECORDING either — hence the "Unsupported item type" fallback branch and its literal message.

Fix

Added a BaseItemKind.RECORDING -> branch in destination(), mirroring the existing EPISODE branch's logic: check data.seasonId — if present (a recorded episode), redirect to Destination.SeriesOverview(...) with the right season/episode ids; otherwise (a recorded movie), redirect to Destination.MediaItem(itemId = id, type = BaseItemKind.MOVIE, ...).

This is safe because MovieDetails/MovieViewModel only use destination.itemId to re-fetch the item fresh from the server — the type field is purely used for the top-level page-dispatch when, not by the destination page itself.

Verified on-device against an actively-recording movie: the details page now renders correctly (with a "Recording" indicator from a separate change), and pressing Play starts playback normally.

BaseItem.destination() switched on `type`, but a DVR recording's
type is always RECORDING regardless of whether the underlying
content is a movie or a series episode. Movie recordings fell into
the else branch, producing a MediaItem destination with
type=RECORDING, which DestinationContent has no page for -- so
selecting a recording in Recorded Movies showed "Unsupported item
type: Recording" instead of the movie's details page.

Fix: add a RECORDING branch that redirects the same way the
existing EPISODE branch already does -- to SeriesOverview when the
recording has a seasonId (a recorded episode), otherwise to
MediaItem with type=MOVIE.

Verified live against an actively-recording movie (The Lord of the
Rings: The Return of the King): the details page now renders (with
the "Recording" indicator) and Play works.
@damontecres

Copy link
Copy Markdown
Owner

Thanks for submitting this PR. Please fix the PR description to match the template provided when opening a pull request. Additionally, please review the AI/LLM policy again.

This branch has not been deployed

No deployments
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