Skip to content

feat(streaming): merge shows and movies into unified titles tab - #163

Merged
Aryan447 merged 9 commits into
mainfrom
feat/titles-tab
Nov 6, 2026
Merged

Aryan447 merged 9 commits into
mainfrom
feat/titles-tab

Conversation

@Aryan447

@Aryan447 Aryan447 commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Consolidates TV shows and movies from separate tabs into a single unified Titles tab at canonical index 1 by default.
  • Added user preference under Settings → Appearance → Bottom navigation allowing users to switch between the unified Titles tab and separate TV Shows (Icons.Filled.Tv) & Movies (Icons.Filled.Movie) tabs, with individual visibility toggles for each.
  • Top-level category control (All | TV Shows | Movies) placed directly on the primary filter chip bar above the grid/list on the unified Titles tab.
  • Beside Sort: compact trailing dropdown buttons for watch filter (TitleWatchFilterButton) and movie duration filter (MovieDurationFilterButton).
  • Directly binds and persists active filter selection (All, TV Shows, or Movies) in StreamingPreferences so choices persist across app restarts.
  • Normalizes sorting across mixed lists (Name, Recently added, Highest rated, Longest, Shortest) using episode counts for shows and duration for movies.
  • Keeps canonical index 2 reserved when unified Titles is active so historical launcher shortcuts and requestTab(2) automatically open Titles with the Movies filter preselected (or direct Movies tab if separate tabs are enabled).
  • Retains existing card variants, badges, progress, two-pane detail view, and movie deletion flows.

Before / After

Metric Before After
Bottom navigation tabs 6 5 (default unified Titles) or 6 (opt-in separate TV Shows & Movies)
Settings → Appearance → Bottom nav Fixed 5 tabs User can toggle Unified Titles vs Separate TV Shows & Movies

How measured

Unmeasured; structural navigation and UI consolidation.

Verification

  • git diff --check passed cleanly.
  • Unit test suites updated/added (MainTabsTest.kt, TitlesSortTest.kt).
  • User-visible text added to strings.xml.
  • CHANGELOG.md Unreleased entry added.
  • CI Build passing.

Risks

None. Canonical index mapping and tab migration preserve backward compatibility for launcher shortcuts and existing user tab configurations.

Shows and movies previously occupied separate navigation tabs with split
filters and grids.

Merges both media types into a single Titles tab at canonical index 1
with a segment control (All, Shows, Movies), normalized sorting,
composed watch-state and duration chips, while keeping index 2 reserved
for launcher shortcuts and external requests.

Impact
- Navigation tabs: 6 -> 5 (-1 tab)

Method: unmeasured; layout and navigation consolidation

Verified
- git diff --check
- MainTabsTest, TitlesSortTest
- CHANGELOG.md Unreleased entry
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T05:51:28.291112Z 60a8c1e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sourcery-ai

sourcery-ai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Sorry @Aryan447, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 1 hour by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR consolidates shows and movies into a five-tab Titles experience backed by a unified TitleItem model and shared filtering/sorting UI, while migrating legacy tab preferences and routing index 2 to Titles with Movies preselected; existing media cards, detail flows, layouts, and deletion behavior are retained.

Sequence diagram for legacy Movies tab routing

sequenceDiagram
    participant Launcher
    participant MainScreen
    participant TitlesScreen
    participant TitlesUI as Titles UI

    Launcher->>MainScreen: requestTab(2)
    MainScreen->>TitlesScreen: preselectFilter(TitlesTypeFilter.MOVIES)
    MainScreen->>MainScreen: persistentSelectedTab = 1
    MainScreen->>TitlesUI: open TitlesScreen at index 1
    TitlesScreen->>TitlesUI: apply pending Movies filter
Loading

File-Level Changes

Change Details Files
Replace separate Shows and Movies navigation entries with a unified Titles destination while preserving historical routing behavior.
  • Define TITLES as canonical index 1 and reserve index 2 for movie-filtered Titles requests.
  • Map persisted SHOWS/MOVIES keys and legacy canonical requests to TITLES.
  • Update bottom-navigation previews and screen dispatch for the five-tab layout.
app/src/main/java/app/aryan447/mpvium/ui/browser/MainScreen.kt
app/src/main/java/app/aryan447/mpvium/ui/browser/MainTabs.kt
app/src/test/java/app/aryan447/mpvium/ui/browser/MainTabsTest.kt
Implement a unified Titles browsing screen that combines shows and movies with shared filtering, sorting, search, layouts, and detail interactions.
  • Wrap series and movie models as TitleItem values and apply type, watch-state, duration, search, and sort transformations to one list.
  • Normalize mixed-media sorting, including episode-count and duration comparisons for length ordering.
  • Reuse existing card/list variants, metadata, progress, detail panes, refresh behavior, and movie deletion flow.
  • Persist Titles layout, type-filter, and sort preferences and support launcher-driven movie filter preselection.
app/src/main/java/app/aryan447/mpvium/ui/streaming/titles/TitlesModels.kt
app/src/main/java/app/aryan447/mpvium/ui/streaming/titles/TitlesScreen.kt
app/src/main/java/app/aryan447/mpvium/preferences/BrowserPreferences.kt
app/src/main/java/app/aryan447/mpvium/preferences/StreamingPreferences.kt
app/src/main/java/app/aryan447/mpvium/ui/streaming/components/LibraryFilterBar.kt
app/src/test/java/app/aryan447/mpvium/ui/streaming/titles/TitlesSortTest.kt
Add localized user-facing copy and document the unified navigation and compatibility behavior.
  • Add Titles labels, search text, filter-specific result and empty states, and detail-pane messaging.
  • Record the consolidated Titles tab and reserved historical index in the Unreleased changelog.
app/src/main/res/values/strings.xml
CHANGELOG.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60a8c1e8d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +61 to +63
val effectiveKeys = if ("SHOWS" in enabledKeys || "MOVIES" in enabledKeys) {
enabledKeys + TITLES.key
} else {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize saved tab keys before deriving visibility

On an upgraded install whose bottom_nav_tabs still contains SHOWS or MOVIES, this branch keeps TITLES visible, but AppearancePreferencesScreen checks only for the exact TITLES key and displays its switch as off. Turning it off cannot hide the tab because the stale key keeps adding it to the visible tabs; migrate or remove the legacy keys when normalizing the preference.

AGENTS.md reference: AGENTS.md:L100-L101

Useful? React with 👍 / 👎.

Comment on lines +111 to +115
if (index == 2) {
TitlesScreen.preselectFilter(TitlesTypeFilter.MOVIES)
persistentSelectedTab = 1
_tabRequest.value = 1
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the series shortcut filtered to shows

The still-registered series shortcut in app/src/main/res/xml/shortcuts.xml sends extra_tab=1, but this branch only preselects a type for index 2. The series shortcut therefore opens Titles with the persisted filter—Movies if that was last selected, or All on a fresh install—instead of showing shows. Preserve the shortcut's intent by preselecting Shows for index 1 or updating the shortcut.

AGENTS.md reference: AGENTS.md:L100-L101

Useful? React with 👍 / 👎.

override fun compare(a: TitleItem, b: TitleItem): Int {
return when {
a is TitleItem.Show && b is TitleItem.Show -> {
a.series.totalEpisodes.compareTo(b.series.totalEpisodes)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Compare shows and movies with a consistent length metric

In TitleLengthComparator, show-to-show comparisons use episode count, while show-to-movie comparisons use total duration. For example, a 3-episode, 90-minute show is ranked ahead of a 2-episode, 200-minute show, the 2-episode show ahead of a 150-minute movie, and the movie ahead of the 3-episode show. This cycle prevents Longest and Shortest from producing a consistent order for libraries with episodes of very different lengths; use one metric across comparisons.

Useful? React with 👍 / 👎.

The Titles screen referenced R.string.search which was not declared in
strings.xml, causing a compile failure in CI.

Adds the missing string resource.

Method: unmeasured

Verified
- git diff --check
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Deploying mpvium with  Cloudflare Pages  Cloudflare Pages

Latest commit: bf5c24a
Status:⚡️  Build in progress...

View logs

Replaces the separate segment control line by displaying All | Shows |
Movies directly on the primary chip row.

Watch-state filtering is now an icon button with a dropdown menu beside
the sort button, matching the duration filter button pattern.

Impact
- Filter chip rows above the grid: 2 -> 1 (-1 row)

Method: unmeasured; layout consolidation

Verified
- git diff --check
- CHANGELOG.md Unreleased entry updated
Updates the Titles tab segment chip label from "Shows" to "TV Shows",
along with result count nouns and empty state copy.

Method: unmeasured; copy update

Verified
- git diff --check
- CHANGELOG.md Unreleased entry updated
sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Nov 5, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

@sourcery-ai
sourcery-ai Bot dismissed their stale review November 5, 2026 06:29

Sourcery withdrew this approval because the latest commits introduced blocking findings.

@Aryan447
Aryan447 merged commit f0f87bc into main Nov 6, 2026
6 of 7 checks passed
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.

1 participant