Repository navigation
Description
Summary
Problem:
The user's History view remains completely empty ("0 RESULTS") even immediately after watching a TV episode to completion. The playback event is not being logged or displayed in the history UI.
Steps to Reproduce:
Watch a TV episode (e.g., Silo) to completion (or mark it as watched).
Navigate to the profile's History page.
Set the filter to "Episodes".
Observe the results list.
Expected:
The recently watched episode should be logged and immediately visible in the History list.
Actual:
The list returns "0 RESULTS" and displays "No items found." Changing the sorting options or dropdowns does not resolve the issue; the history remains completely blank.
Reply digest
The profile History view shows "0 RESULTS" even immediately after watching a TV episode to completion (or marking it watched).
Repro: watch an episode to completion -> profile History page -> set the media filter to "Episodes" -> 0 RESULTS / "No items found"; changing sort/filters doesn't help.
Root cause verified in code: the history write path is intact (both playback-stop and mark-watched insert into user_watch_history correctly). The bug is on the read side: both history read paths deliberately collapse episode history rows into their SERIES display item, but the History page still offers an "Episodes" media-type option. With type=episode, the resolved SERIES content ids are filtered against media_items.type='episode' — structurally guaranteed zero results, always. The "completely blank even unfiltered" variant is data-dependent: the INNER JOIN on media_items silently drops history rows whose episode id can't resolve to an existing series row (e.g. legacy pre-#155 episode ids orphaned by the deterministic content-id re-key, or episodes of an unmatched series).
Suggested direction: either hide the "Episodes" scope on the history source, or resolve history to episode-level display items when the episode scope is selected.
Code references
Verified not fixed as of 2026-07-04 at origin/main 60931db; checked #174 (5172155), #279 (878492c), #280 (3d82aa5), plus merged-PR search for 'history' (latest history-adjacent merges #254/#179 pre-date the report).
- internal/catalog/history_source.go: buildHistoryDisplayBaseQuery collapses episodes to series display ids and INNER JOINs media_items — episode-type filters can never match, and unresolvable episode ids are silently dropped
- internal/catalog/catalog_resolver.go: resolvePersonalSource -> loadPersonalSourceIDs returns SERIES ids, then fetchAccessibleItemsByID applies media_scope=episode (BrowseFilters.Type='episode') over them -> guaranteed empty
- internal/catalog/history_display.go: ResolveHistoryDisplayIDs — episodes whose row is missing from the episodes table fall through as raw ids and vanish at the media_items join
- web/src/components/catalog/CatalogFilterBar.tsx:42 + web/src/components/catalog/CatalogFiltersPanel.tsx:109: 'Episodes' scope option is offered on the History page (allowEpisodeMediaScope only excludes collection sources) even though the history source can never yield episode-typed items
Attachments
Source
Imported from Discord:
Activity
fix(catalog): resolve episode-scoped history to episode-level items (#…
fix(catalog): resolve episode-scoped history to episode-level items (S…