fix: hide stale mid-season episode tags and surface type in details#155
fix: hide stale mid-season episode tags and surface type in details#155vladjerca wants to merge 4 commits into
Conversation
Mid-season finale and premiere tags previously stuck around past the mid-season cut. Once a newer episode aired they stopped being actionable but still read as "Finale" / "Premiere" on the up-next surfaces, making it look like the show had ended. Gate the tag on whether the episode is the latest aired episode of the show, derived from the progress endpoint's `last_episode`. Series and season finales / premieres are unaffected. Refs trakt-web#2367
The episode tag on cards intentionally collapses series/season/mid-season finales and premieres into a single "Finale" / "Premiere" label so the card UI stays minimal. The exact variant (mid-season finale, season premiere, etc.) was not surfaced anywhere on the client, so users had no way to recover the full metadata once the tag was generic or hidden. Add a new "Type" row to the episode details meta info that renders the specific variant via a new `episodeTypeStringRes` helper on `Episode`. Six new string resources cover the finale / premiere variants. Refs trakt-web#2367
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the display of episode status tags on up-next cards by introducing conditional logic to hide stale mid-season tags. It also improves metadata transparency by surfacing the specific episode type in the details view, ensuring users have access to full context even when card-level tags are suppressed. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces specific episode type tracking (e.g., mid-season finales) and an isLatestAired flag to manage tag visibility in the 'Up Next' sections. It includes a new utility for comparing episode IDs, updates the Episode model with resource mapping, and adds a 'Type' field to the episode details UI. Feedback highlights potential issues with the monotonic ID assumption for special episodes and suggests using enums instead of string-based checks for better maintainability.
Mirrors the web reference implementation and removes reliance on `SeasonEpisode.id`'s `season * 10_000` packing, which would silently break for any season with >= 10000 episodes (impossible in practice, but the tuple compare is clearer and matches the source PR).
progress.last_episode is the user's furthest watched episode, not the show's latest aired episode. Comparing next_episode against it is effectively always true (next is the first unwatched after last_watched by definition), so the previous gate never actually hid a stale tag. As a proxy, treat the next episode as the latest aired when the remaining count (aired - completed) is 1 or less - meaning no further aired episode exists beyond the displayed one. Drops the isLatestAiredEpisode helper, with a FIXME to replace once the API exposes an absolute "latest aired episode" reference.
|
NOTE: Tyson flagged on the iOS mirror (trakt-apple-internal#126) that the gate this PR introduces is a no-op - Pushed an interim fix: derive |
Summary
Mirrors trakt-web#2367 on Android (app + tv modules).
Staleness is derived from the show progress endpoint's
last_episode: an episode is considered the latest aired if it is>= last_episodeby (season, number), via the existingSeasonEpisode.idordering.Test plan