feat(details): synopsis and cast on long press - #419
Open
Pierroons wants to merge 3 commits into
Open
Conversation
Long-pressing a channel opened a sheet offering Favourite, Hide and Create shortcut, and said nothing about the title itself. Other clients show a synopsis and a cast there. Xtream keeps that apart from the catalogue: get_vod_streams returns names and artwork only, so each description costs a get_vod_info call — which is why it is fetched when the sheet opens rather than up front. Series answer the same shape on get_series_info. Tapping a channel still plays it immediately. The description sits behind a long press so nothing is added between a viewer and their film. Details are cached in channel_details, keyed on (playlist, channel reference) rather than on the channel row id: ids are regenerated on every re-subscription, which is the only way to refresh a catalogue, so keying on them would discard the cache each time. Requests are serialised behind a mutex. These accounts commonly allow a single connection and it is shared with playback — several descriptions fetched at once can cost the viewer their stream. A row is written even when the panel has nothing to say, so "asked, has no description" stays distinguishable from "never asked" and the sheet does not re-ask on every open. The call is issued from this module rather than from the parser submodule, which models the episode list of get_series_info but not the descriptive block. Only its URL builder is reused, so this stays a single-repository change. Panels disagree on their own field types — rating arrives as 5, "5" and 7.4, tmdb_id alternates just as freely, movies say releasedate where series say releaseDate. A lenient reader keeps a sheet from being lost over a field nobody reads as a number; five tests pin those shapes down. Verified on device: long press on a film shows 2017 · Action, Science-Fiction, Thriller ★ 5.6, its cast, its director and its synopsis, and the row lands in the cache with the folded cast ready for search. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
data/.gitignore excluded /src/test, so the module could not carry unit tests at all. The entry is dropped and five come with it. They cover what panels actually send: a rating as a bare number, tmdb_id alternating between number and string, movies spelling releasedate where series spell releaseDate, cast falling back to actors, plot to description, and unknown fields appearing without warning. Any of those refused outright would cost the sheet its content. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… method The instrumented test was left behind: PlaylistRepositoryImpl gained a channelDetailsDao parameter and XtreamParser gained getChannelDetailsOrNull, and the test's fake parser implemented neither. CI caught it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
First half of #418, split as you asked. Search by cast follows separately.
Long-pressing a channel opens a sheet with Favourite, Hide and Create shortcut, and says nothing about the title itself. This adds the synopsis, cast, director, genre, year and rating.
Xtream keeps that out of the catalogue:
get_vod_streamsreturns names and artwork only, so each description costs its ownget_vod_infocall (~0.21 s measured). Series answer the same shape onget_series_info. It's fetched when the sheet opens, not up front — tapping a channel still plays it immediately.Cache. Keyed on
(playlist_url, relation_id), not the channel row id: ids are regenerated on every re-subscription, which is the only way to refresh a catalogue, so keying on them would discard everything each time.No foreign key on the table, deliberately. Re-subscribing writes the playlist back with
INSERT OR REPLACE, which SQLite performs as delete-then-insert — anON DELETE CASCADEempties the cache on every refresh. Measured before catching it: 401 rows before, 0 after. Rows are deleted explicitly on unsubscribe instead.Requests are serialised behind a mutex. These accounts commonly allow a single connection and it is shared with playback; several descriptions fetched at once can cost the viewer their stream. A row is written even when the panel has nothing to say, so "asked, has nothing" stays distinct from "never asked".
The parser submodule is untouched — only its URL builder is reused, so this stays a single-repository change.
Five tests pin down the payload shapes, since panels disagree on their own field types:
ratingarrives as5,"5"and7.4,tmdb_idalternates between number and string, movies sayreleasedatewhere series sayreleaseDate.data/.gitignoreexcluded/src/test, so the module could not carry unit tests at all; that entry is dropped.Verified on device against a 22 822 film / 5 332 series catalogue: long press shows year, genre, rating, cast, director and synopsis, and the cache survives a full refresh intact.