Portal catalog, downloads, and recordings
Portal content is presented as a set of searchable catalog views, while provider media and live-TV recordings are managed from one desktop workspace. The catalog keeps provider-specific data behind one user flow. The download path resolves a provider URL first, then tracks the transfer and the resulting local file by its portal source and media identity. The recording path tracks scheduled live-TV captures from start to finish and keeps them separate from provider downloads.
This page is a child of Provider portals. For the main differences between the supported portal types, see Xtream and Stalker portals. For the relationship between local files and provider playback, see Media playback.
Catalog experiences
Shared catalog contract
The shared catalog contract gives the portal shell one way to display categories, content, selection, search, refinement, progress, and detail views. The concrete provider service supplies the data and provider actions, so the catalog experience can stay consistent even when the provider does not support the same features. This contract is defined in libs/…/portal-catalog-facade.ts.
The catalog flow has these main parts:
- A portal selects the active content type and category.
- The view shows the current content window and its item count.
- Search and supported refinements change the result set.
- Infinite scrolling asks the provider for more content when the user reaches the end.
- Selecting an item opens a provider detail view or navigates to one.
- Playback progress is added to each item without changing the provider record.
The contract also carries playlist identity. That identity keeps progress and saved scroll positions tied to the correct portal when the user changes sources or returns from a detail view.
References: libs/…/portal-catalog-facade.ts• L4-86 libs/…/category-content-view.component.ts• L81-181
Recent playback collection
The recent playback collection gives the portal workspace one time-ordered view of content played across Xtream, M3U, and Stalker sources. It supports both a global view and a playlist-scoped view, then maps each source into the common collection shape so the surrounding catalog can use one set of display and removal actions.
Live playback records the source identity and display metadata in the store that owns that portal type. Removing or clearing items uses the same source boundary, while batch removal groups playlist-backed records before writing so one update does not overwrite another. When history archive mode is active, the service can project retained history for the view and update the UI without persisting the received projection over that archive.
References: libs/…/unified-recent-data.service.ts• L57-114 libs/…/unified-recent-data.service.ts• L122-264 libs/…/unified-recent-data.service.ts• L266-377 libs/…/unified-recent-data.service.ts• L379-568 libs/…/unified-recent-data.service.ts• L571-765 libs/…/history-archive-notification.spec.ts• L5-32
Catalog refresh and removal
Catalog refresh replaces the stored categories and content for one portal while protecting user state that can be restored. The refresh first captures provider identities for favorites, hidden categories, and recently viewed items. It then removes only the categories and content that belong to the captured portal data before the new catalog is used.
Large catalog changes are split into scoped work units. The database reports progress and checks for cancellation between units, so a refresh can stay responsive without allowing a later import of the same portal to be removed by an older cleanup step. After the new content is present, saved favorites and recently viewed items are matched by provider content identity and restored when their items still exist.
References: apps/…/catalog-deletion.ts• L11-24 apps/…/catalog-deletion.ts• L138-193 apps/…/xtream.operations.ts• L41-175 apps/…/xtream.operations.ts• L261-377
Category content
The category content view is the common catalog surface for provider-backed movies and series. It shows the selected category as a continuous grid rather than a page-by-page control. The header keeps the category context and active refinements visible as the available content area changes size. In narrow panes, refinement chips wrap below the title and refine action while the grid keeps its own scroll area, so the controls remain usable as the layout contracts.
Sorting and rating filtering share one refinement control. Providers expose only the sort and rating choices they support. The header shows active choices as compact chips, while the menu groups sort choices and opens rating thresholds in a separate submenu. The available sort modes cover date and name, with rating order when the provider supports it. A rating threshold can further narrow supported catalogs.
Some VOD catalogs offer two progress-based refinements when the provider supports them. Hide-watched removes items with completed progress. The watch-status filter selects all, unwatched, in-progress, or watched items. These refinements wait for the needed progress state before they change the grid. While that state is loading or has failed, the view keeps the category header and refine controls visible and reports the loading or retry state instead of showing a false count or empty result.
The view keeps provider paging separate from local progress filtering. A source can have more items even when automatic loading pauses because hide-watched has not found enough visible items. The user can continue loading or clear the refinement. An empty or failed watch-status result offers a reset or retry action without discarding other refinements.
Search, sorting, rating, watch status, and hide-watched state form part of the list identity, so changing them starts a new result set and resets the grid to the top. Appending more content keeps the current position. A failed first load shows a catalog error and retry action instead of an empty grid. A failed append stays at the end of the list and exposes a retry action instead of silently skipping a provider page. Legacy page query state is removed rather than treated as a page number because the catalog uses continuous loading.
The view preserves the user's place when a detail view replaces the grid. It saves the scroll offset before selection and when the view leaves. It restores that offset only after the matching category and refinement state is rendered, so a changed result set starts at the top rather than using an old position. Route navigation preserves relevant query state when an item opens, while provider-specific detail presentation remains tied to the selected item.
The view initializes only after the destination portal is ready. A reused category route initializes again when its active playlist changes, which prevents an old portal selection from receiving a new portal's handoff. Stalker navigation state opens the exact selected item, consumes only the state meant for that item, and retires an old return marker when the handoff item is no longer present.
The view chooses its detail component through the shared detail interface. This lets a provider add its own detail behavior while the surrounding category, navigation, and return flow remain common.
This diagram shows how a portal selection becomes a catalog result or a detail view.
flowchart LR
A[Portal source] --> B[Provider catalog facade]
B --> C[Category and content state]
C --> D[Search and supported refinements]
D --> E[Infinite content grid]
E --> F[Selected item]
F --> G[Provider detail view]
G --> H[Playback progress and return position]
H --> E
References: libs/…/category-content-view.component.ts• L103-205 libs/…/category-content-view.component.ts• L229-327 libs/…/category-content-view.component.ts• L338-428 libs/…/category-content-view.component.html• L28-137 libs/…/category-content-view.component.html• L216-286 libs/…/category-content-view.component.html• L331-448 libs/…/category-content-view.component.spec.ts• L285-380 libs/…/category-content-view.component.spec.ts• L382-610 libs/…/category-content-view.component.spec.ts• L829-1161 libs/…/category-infinite-scroll-snapshot.cases.ts• L19-95 libs/…/portal-catalog-detail.ts• L1-6
Search experiences
Search gives users a common result surface while keeping the search scope clear. An Xtream search can cover one portal or all portals. The all-portal view can filter by content type, hide hidden categories, group results by portal, and request more server results. The in-portal view searches the loaded catalog and reveals results in scroll-sized windows.
Stalker search uses provider pages and presents them as one continuous result set. It deduplicates rows, retries a failed append page, and resets its page identity when the term, content type, or portal changes. Parental locks remove withheld rows from both the result list and any open detail view. Pages that contain only newly withheld rows still count as progress, so visible matches can be found later.
References: libs/…/search-results.component.ts• L45-71 libs/…/search-results.component.ts• L164-237 libs/…/search-results.component.ts• L359-485 libs/…/search-results.component.html• L43-184 libs/…/search-results.component.spec.ts• L267-324 libs/…/search-results.component.spec.ts• L478-539 libs/…/stalker-search-paging.controller.ts• L69-104 libs/…/stalker-search-paging.controller.ts• L159-235 libs/…/stalker-search-paging.controller.ts• L250-297 libs/…/stalker-search-paging.controller.ts• L350-395 libs/…/stalker-search.component.html• L1-87 libs/…/stalker-search.component.spec.ts• L427-648
Category management
Category management controls which provider categories appear and which categories require a parental lock. Xtream presents category search, visibility selection, item counts, and lock controls in one dialog. Stalker presents a lock list with search, a locked count, a censored-category shortcut, and an unlock-all action. Changes stay in a draft until the user saves them.
The dialog adapts its controls to the available portal mode. Visibility selection is used where the client can hide categories, while lock controls remain available for parental protection. The list keeps the search and bulk controls visible while the category rows scroll.
References: libs/…/category-management-dialog.component.html• L14-173 libs/…/category-management-dialog.component.scss• L3-190 libs/…/stalker-category-lock-dialog.component.html• L8-117 libs/…/stalker-category-lock-dialog.component.scss• L13-173
Cached catalog status
An Xtream catalog can remain useful after the provider becomes unavailable if its content was already initialized. In that state the route stays open and shows a status notice with a retry action. If content initialization is blocked, the gate shows the reason and keeps the child catalog route closed until initialization is retried.
The retry path checks the same selected portal after it resets the host connectivity guard. This prevents a slow retry for one source from checking a different source selected while the request was pending.
References: libs/…/xtream-content-gate.component.ts• L26-51 libs/…/xtream-content-gate.component.ts• L62-93 libs/…/xtream-cached-offline-notice.component.ts• L24-71 libs/…/xtream-cached-offline-notice.component.ts• L81-116 libs/…/xtream-cached-offline-notice.component.scss• L9-76 libs/…/xtream-content-gate.component.scss• L3-17 libs/…/xtream-status-layout.scss• L1-19 libs/…/xtream-cached-offline-notice.component.spec.ts• L63-177 libs/…/xtream-content-gate.component.spec.ts• L103-169
Provider differences
Xtream and Stalker use the same catalog surface but have different data and paging capabilities. The provider facade exposes those differences as capabilities instead of forcing the view to guess how a portal behaves.
| Capability | Xtream | Stalker |
|---|---|---|
| Content loading | Builds the visible catalog from the provider store and appends in-memory content windows. | Loads provider pages and reports append activity and append errors. |
| Search | Sends the category search term to the Xtream store. | Sends a search phrase to the Stalker store and accumulates provider pages. |
| Sorting | Supports date, name, and rating order. | Does not expose local sort modes. |
| Rating refinement | Supports rating sort and a minimum rating for VOD and series. | Hides rating controls because the catalog has no matching structured capability. |
| Item selection | Returns route segments based on the category and item identity. | Stores the selected item and can prepare an embedded series selection. |
| Favorites and playback links | Uses the Xtream feature flow. | Provides Stalker-specific favorites and link resolution actions. |
Both providers also attach playback state to catalog items. Stalker scopes that state to the active playlist and treats episode positions as series watch state, so a portal switch does not place progress from one source on another source's catalog.
The shared view therefore describes what the user can do, while each facade decides whether the provider can do it and how to obtain the next result.
References: libs/…/xtream-catalog-facade.service.ts• L26-77 libs/…/xtream-catalog-facade.service.ts• L79-182 libs/…/stalker-catalog-facade.service.ts• L42-168 libs/…/stalker-catalog-facade.service.ts• L181-301 libs/…/stalker-catalog-facade.service.ts• L340-400 libs/…/stalker-search-paging.controller.ts• L250-297
Download initiation
Provider media resolution
A download starts from a playable provider item, not from a catalog label alone. The provider detail flow resolves the media source and submits a common download request with the source URL, portal identity, display data, and any headers needed to reach the provider.
The two provider paths differ at source resolution:
- Xtream can construct a VOD stream URL from the selected item. Series episodes use their episode stream URL.
- Stalker may need a movie file ID or a temporary link before the download can start. The resolved link is then passed to the common service with the portal credentials represented by the provider's allowed request headers and link form.
Both paths also capture a metadata snapshot. The snapshot supports the offline detail view after the provider is no longer available. It can include title, artwork, dates, rating, people, and series episode facts, while the download itself remains tied to the provider stream URL.
On an Xtream detail page, the primary action uses the local file when a completed download exists. If the stored file is missing, the page returns to provider playback instead of claiming that the item is offline. A provider-only detail presentation hides local download actions. The same detail flow exposes download start, pause, resume, cancel, and local-file access without changing the provider item identity.
References: libs/…/vod-details-downloads.service.ts• L203-276 libs/…/vod-details-playback.service.ts• L164-209 libs/…/vod-details-route.component.html• L1-149 libs/…/vod-details-route.component.ts• L301-337 libs/…/vod-details-route.component.ts• L577-633 libs/…/vod-details-route.component.ts• L732-760 libs/…/vod-details-route.actions.spec.ts• L400-565 libs/…/vod-details-route.actions.spec.ts• L608-718 libs/…/stalker-vod-download.ts• L115-201 libs/…/download-metadata-snapshot.ts• L267-319
Download identity
The download manager treats a media item as belonging to a particular playlist and content identity. This prevents the same title from different portals from being merged and prevents repeated clicks from creating parallel rows for one item.
Movies use their provider item identity. Episodes add the series identity plus season and episode numbers. Stalker series modes also carry an identity scope because an embedded VOD episode and a regular series episode can share visible numbers while representing different provider records.
Before a request enters the transfer queue, the desktop side checks the destination folder, validates the remote URL, and checks for an existing matching download. A matching active item is rejected as already in progress. A completed item is reused unless its local file is missing and the request is eligible for recovery.
References: libs/…/models.ts• L8-37 apps/…/download-requests.ts• L25-44 apps/…/download-requests.ts• L104-229 libs/…/stalker-series-download.adapter.ts• L37-53
Series episode batches
Series downloads use a shared coordinator so one episode and a whole season follow the same identity and duplicate rules. A provider adapter turns each episode into a candidate. The coordinator checks eligibility, prepares the source request, submits it, and reports added, skipped, or failed results.
Xtream adapters build direct episode URLs. Stalker adapters resolve a playable episode URL and record the Stalker series mode with the request. The coordinator reserves identities while a batch is being prepared, which protects against duplicate submissions from rapid actions or overlapping batch work.
References: libs/…/season-download.models.ts• L5-30 libs/…/season-download-coordinator.service.ts• L29-129 libs/…/xtream-series-download.adapter.ts• L58-135 libs/…/stalker-series-download.adapter.ts• L94-180
Download management
Download states
The download service is the renderer-side view of the desktop download system. It loads the persisted list and preferred folder, exposes availability, and refreshes its state when the desktop process reports a change. Downloads are available only when the runtime provides the desktop bridge.
The main states have these meanings:
| State | Meaning in the product |
|---|---|
queued | The request is accepted and waits for transfer. |
downloading | The desktop process is transferring the provider media. |
paused | Transfer can continue later from its saved partial file. |
completed | A final local file is recorded and available, unless file checking marks it missing. |
failed | The transfer stopped with an error and can be retried. |
canceled | The user stopped the request or removed it from active work. |
The desktop runtime runs one active transfer at a time and keeps later requests in a queue. It persists status and byte progress so the manager can show determinate progress when the total size is known and an indeterminate state when it is not. The queue shows non-empty active and attention sections, and marks a missing local file as an attention state even when the stored transfer status is complete. A missing file also offers a download-again path when the source can be recovered.
References: libs/…/downloads.service.ts• L16-84 libs/…/downloads.service.ts• L90-163 apps/…/download-runtime.ts• L31-47 apps/…/download-runtime.ts• L135-163 libs/…/download-queue.component.ts• L84-110 libs/…/download-queue.component.ts• L112-169 libs/…/download-queue.component.html• L145-231 libs/…/download-queue.component.scss• L43-79
Download library
The downloads page separates work in progress from media that is ready to watch. Active and paused rows remain in the active view. Failed, canceled, and completed rows whose local file is missing remain in the attention view. Completed rows with an available file become library entities shown as poster cards, while series cards provide access to their downloaded episodes.
The library groups episode rows by playlist and series identity. A series card shows its episode count and season range. Movies, provider catch-up items, and ungrouped episodes remain individual cards. Users can filter by all media, movies, series, work in progress, or recordings. Movie and series filters hide recording rows, while the recording filter hides provider download rows. Search covers titles, source names, episode labels, and error text. A series card can open its local episode list even when an episode action is pending.
Selecting a series card opens an episode list that follows the current group membership. Each row exposes its episode identity and local size, then routes play, folder, URL-copy, and removal actions through the shared manager. A pending episode disables its own actions. If the authoritative download list changes, the dialog removes episodes that no longer belong to the group and updates its count.
The manager scopes these views to the selected portal and keeps the recording count separate from provider download counts. It loads the authoritative download list before applying a portal route scope, so retained local media can remain visible after its source playlist is removed. The source name on each row also shows which portal produced the local media. Recordings use a separate live-TV section because they have a different lifecycle and wide channel artwork rather than movie or series poster cards.
References: libs/…/download-manager.viewmodel.ts• L22-55 libs/…/download-manager.viewmodel.ts• L141-250 libs/…/download-library.component.ts• L41-99 libs/…/download-library.component.scss• L28-237 libs/…/download-library.component.ts• L137-153 libs/…/download-library.viewmodel.ts• L205-260 libs/…/downloads.component.html• L86-120 libs/…/downloads.component.html• L201-255 libs/…/downloads.component.scss• L13-219 libs/…/downloaded-series-dialog.component.ts• L43-104 libs/…/downloaded-series-dialog.component.html• L1-99 libs/…/downloaded-series-dialog.component.scss• L19-125 libs/…/downloaded-series-dialog.component.spec.ts• L117-245
Local file access
The downloads page owns the user's preferred destination folder and offers actions for the managed local file. Users can pause, resume, retry, cancel, remove, play, reveal, copy the source URL, or clear terminal records. A completed row is usable only when the desktop side confirms that its file exists. The queue blocks actions for rows with a pending operation, does not open catch-up rows from the queue, and limits cancel or remove actions to states where they are safe.
Each item action uses a pending guard. The guard prevents overlapping operations for one row and clears itself after success or failure. Clearing finished records can be limited to one portal, while missing-file and file-action errors refresh the list or show a recovery path when the desktop cannot complete the request. Removal and clearing use confirmation steps because they change the local record set; the confirmation distinguishes a completed file that stays on disk from retained partial data that is removed.
When a file is missing, the row moves to the attention view instead of pretending that the download is ready. The user can ask the desktop process to recover the missing file or remove the record. If cleanup needs manual recovery, the manager keeps the recovery path available for copying. Play and reveal actions also verify that the path belongs to a managed download before opening it.
An offline detail view opens from a download identity and builds a movie or series view from the loaded download list. It can show the saved metadata snapshot with facts such as cast, creators, rating, duration, and file size. Series details group downloaded episodes by season and give each episode its own play and reveal actions. Provider-specific fields are mapped into the common snapshot shape, with the saved snapshot as a fallback, before optional TMDB enrichment adds or improves details. Metadata refresh is keyed to the download and language, so a newer valid result can replace the snapshot without allowing an older request to do so. If the snapshot needs refresh, the system identifies the provider type from the playlist, tries to recover current provider metadata, and can enrich it from TMDB when enabled. It keeps the local snapshot when those sources fail and writes back only the latest valid result. If the matching provider playlist is available, the view can offer a route back to the live provider item; otherwise the local detail remains the useful source and the portal action is unavailable.
References: libs/…/downloads.component.ts• L266-356 libs/…/download-manager-actions.service.ts• L24-71 libs/…/download-manager-actions.service.ts• L79-145 libs/…/download-manager-actions.service.ts• L161-239 libs/…/downloads.component.spec.ts• L614-854 libs/…/downloads.service.ts• L262-355 libs/…/download-queue.component.ts• L112-153 libs/…/download-queue.component.html• L95-167 libs/…/download-offline-detail.component.ts• L83-145 libs/…/download-offline-detail.component.ts• L181-248 libs/…/download-offline-detail.component.ts• L277-311 libs/…/download-offline-detail.component.html• L59-159 libs/…/download-offline-detail.component.html• L214-396 libs/…/download-offline-detail.component.scss• L44-168 libs/…/download-offline-metadata.service.ts• L128-211 libs/…/download-offline-metadata.service.ts• L214-300 libs/…/download-offline-provider-coordinator.service.ts• L38-131 libs/…/download-metadata.mapper.ts• L21-277
Recording tracking
Scheduled live-TV captures enter the workspace as recording items from the desktop runtime. The recording service keeps one current list, refreshes it after recording-change events, and polls while a capture is active so elapsed time and file size stay current. This gives the portal a live view without treating an unfinished recording as a completed download.
The recording view divides items by product state:
- Recording now contains active captures. It shows elapsed wall-clock time and the growing file size because the final duration is not known.
- Needs attention contains failed captures and playable recordings whose local file is missing.
- Recordings contains completed or interrupted captures whose local file is available.
Each row also carries the program title when guide data provides one, the channel name, a duration after a valid end time, and an interrupted marker. If no program title exists, the view can fall back to channel and start-time context.
The recording view scopes rows to a portal and searches program titles, channel names, source names, and error text. The All and recording views show all recording states, while in-progress shows active captures only. The All count includes recordings, and the active badge and in-progress count include active captures. The recording badge count remains the number of recordings in the selected portal, independent of the active filter. Movie and series filters hide recordings.
This diagram shows how a scheduled capture becomes a tracked recording and then a playable local item.
flowchart LR
A[Scheduled live-TV capture] --> B[Desktop recording runtime]
B --> C[Recording item]
C --> D{Current state}
D -->|recording| E[Recording now]
D -->|failed or missing file| F[Needs attention]
D -->|completed or interrupted with file| G[Recordings library]
E -->|runtime update| C
References: libs/…/recordings.service.ts• L12-79 libs/…/recording-manager.viewmodel.ts• L5-25 libs/…/recording-manager.viewmodel.ts• L72-170 libs/…/downloads.component.html• L228-254 libs/…/downloads.component.ts• L160-227 libs/…/recording-queue.component.html• L63-136 libs/…/recording-queue.component.scss• L40-232 libs/…/downloads.component.spec.ts• L496-520
Recording actions
Recording actions manage the local capture rather than request a second copy from the provider. A user can stop an active capture, open its detail view, play or reveal an available file, and remove the recording entry from the manager. Failed or missing recordings do not offer a re-download because the original broadcast may no longer be available.
Each action is tied to the recording identity and is marked pending while the desktop operation runs. The manager blocks repeat actions during that period. Removal asks for confirmation. If play or reveal reports a missing file, the list refreshes before the action settles so the recording moves to Needs attention instead of remaining in the library as if it were usable.
References: libs/…/recording-actions.ts• L1-19 libs/…/recording-manager-actions.service.ts• L24-153 libs/…/downloads.component.spec.ts• L726-854 libs/…/recording-queue.component.html• L138-218 libs/…/recording-queue.component.scss• L234-257 libs/…/recording-library.component.html• L80-131
Recording detail
The recording detail view focuses on one scheduled capture and uses the same detail shell as other offline media. It loads the item by recording identity and shows its program or channel title, duration, file size, timing, and covered programs when one capture spans more than one guide entry. When guide data has no program title, the channel name and time provide the record's context.
The detail view keeps local actions tied to the recording manager. It disables repeat actions while one is pending and returns to the downloads workspace when the recording is removed or the requested identity is no longer in the authoritative list. Its time display uses the user's guide-time setting so the detail view matches other guide surfaces. The detail state also distinguishes an active capture, a failed capture, and a missing local file so the available actions match the recording's current condition.
References: libs/…/recording-detail.component.ts• L33-59 libs/…/recording-detail.component.ts• L61-125 libs/…/recording-detail.component.ts• L127-167 libs/…/recording-detail.component.html• L1-197 libs/…/recording-detail.component.scss• L23-114
Change checklist
When these files or sections are changed, remember to consider these:
- A change to the shared catalog facade must remain compatible with both provider facades and the common category content view. Capability signals control whether search, sorting, rating controls, watch-status controls, paging, and retry behavior appear.
- A change to the catalog sort option list must keep provider capability checks, active-chip labels, menu labels, and the list reset identity aligned.
- A change to the hide-watched or watch-status refinement must keep provider support, progress-state readiness, removable-chip state, retry behavior, automatic-load pause, empty-result handling, and source
has-morereporting aligned. - A catalog refresh or deletion change must keep cleanup scoped to the captured portal data, preserve user-state identities, report progress, and avoid removing rows created by a newer import.
- A change to provider item identity must be carried through selection routes, playback progress lookup, download identity matching, and offline return navigation.
- A catalog-to-detail handoff must preserve query context only for the matching item and must not reuse provider-only presentation or return state after the item or route changes.
- A change to portal readiness or playlist identity must keep category initialization, Stalker handoff consumption, and reused-route reinitialization aligned.
- A change to unified recent playback data must keep global and playlist scopes, source-specific identities, time ordering, batch removal, and history-archive projection separate from persistence.
- A change to search result identity must keep term, content type, hidden-category state, portal, result window, and near-end loading state aligned. Stale responses must not replace a newer result set.
- A change to Stalker parental-lock filtering must keep visible rows, withheld-row progress, open-detail closure, and page termination aligned.
- A change to category management must keep visibility drafts, lock drafts, search results, bulk actions, counts, and save behavior aligned for each portal mode.
- A new provider download path must supply a stable playlist identity, a resolvable media URL, the provider's permitted request headers, and metadata that the offline view can use.
- A change to episode identity must stay aligned across the Xtream adapter, Stalker identity scope, season coordinator, persisted download rows, and duplicate checks.
- A change to download status or file availability must update the queue grouping, library grouping, available actions, and missing-file recovery behavior together.
- A change to download filters or counts must keep portal scoping, provider download rows, recording rows, and the visible filter results aligned. The
Alland active counts must include recordings when the recording bridge is available. The recording filter must not leak provider download rows, and movie or series filters must not leak recordings. - A change to the desktop download bridge must preserve folder authorization and the renderer refresh path, or the UI can show stale state or accept a request that cannot be written.
- A change to download library entity types must keep series grouping, catch-up playback, pending-action guards, artwork fallback, and source labels aligned.
- A change to the downloaded-series dialog must keep live group membership, episode identity labels, per-item pending state, and the shared action dispatcher aligned.
- A change to download actions must preserve per-item pending protection, scoped clearing, truthful removal outcomes, file-action refresh, confirmation behavior, and recovery-path handling.
- A change to offline metadata freshness or provider lookup must preserve local fallback data, provider-specific matching, language state, and protection against an older refresh overwriting a newer one.
- A change to provider-to-snapshot metadata mapping must preserve the common movie and series snapshot shape, provider-specific field fallbacks, episode identity, language, and TMDB enrichment behavior.
- A change to cached Xtream status handling must keep the notice, content gate, retry guard reset, selected-portal check, and routed content frame aligned.
- A change to recording status or file availability must stay aligned across the desktop recording bridge, recording view model, queue and library sections, filter visibility, scoped count, duration, and interrupted-state display.
- A change to recording actions must preserve stop and remove confirmation, per-item pending protection, file-action refresh, and missing-file state transitions.
- A change to recording detail routing or identity lookup must preserve the return path, authoritative-list redirect, pending-action guard, and guide-time display.
- A change to recording update events or active-recording refresh must preserve both the event refresh path and the live size and elapsed-time display.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A provider page append fails | The catalog stops at the failed page and can appear incomplete. | Keep the append error at the list tail and retry that page before loading later pages. |
| The first catalog load fails | The view can look like an empty category and hide the source error. | Show the catalog error state and retry action instead of rendering an empty grid. |
| A provider capability is not carried to the shared refine menu | The user can see or select a sort, rating, or watch action that the provider cannot perform. | Derive controls from facade capability and hide unsupported choices. Keep the active chips and filter state tied to the same capability. |
| Hide-watched or watch-status data is still loading or has failed | The filter can show incomplete results or let the user enable a state that cannot work. | Keep the header visible, suppress false counts and grid results, and show loading, retry, or clear actions. |
| Automatic loading stalls while hide-watched filtering is active | The source may have more content, but the grid can stop without a clear way to continue. | Keep source has-more separate from the paused automatic-load gate and expose a continue action. |
| A result-set refinement changes without resetting the grid | Rows from the old result set can remain visible and the saved position can point into the wrong set. | Include category, search, sort, rating, watch status, and hide-watched state in the reset identity and scroll to the top on change. |
| A saved scroll position is restored before the matching list is ready | The grid can jump to a wrong offset or restore a position from another filter state. | Consume and apply the position only after loading and active filter state are ready. |
| A catalog cleanup uses an unscoped or stale portal filter | Content from another portal or a newer import can be removed. | Require a scoped filter and delete only the category identities captured for that operation. |
| A search response belongs to an older term, filter, portal, or lock state | Older rows can replace current results or make paging stop too soon. | Include the full result identity in the request check and discard stale responses before merging rows. |
| A Stalker page contains only rows hidden by a parental lock | Search can stop before it reaches later visible matches. | Count newly withheld provider rows as page progress, advance through them, and stop on repeated withheld rows or a truly empty page. |
| A category lock or visibility draft is applied to the wrong portal mode | A save can change the wrong category set or expose controls that do not apply. | Keep portal capability checks and draft state separate from the visible filtered list. |
| A received history projection is written back as playlist state | Retained archive data can be replaced by a newer remote projection. | Dispatch the UI update as non-persistent while history archive mode is active. |
| A cached Xtream catalog is treated as unavailable content | Usable local catalog data is hidden, or a blocked import route renders as if it were ready. | Keep the cached notice separate from the content gate and show each only for its matching initialization state. |
| A source changes while a cached-status retry is pending | The retry can report the old source's status for the newly selected source. | Reset the host guard first, then verify that the selected playlist is still the one that started the retry. |
| A Stalker movie needs a file ID or temporary link and resolution fails | No download is queued. | Resolve the concrete playable source before calling the download service. |
| The runtime is not Electron or has no authorized folder | The download cannot start. | Expose download availability and require the desktop-authorized folder. |
| A second request has the same portal and media identity | The user may create duplicate transfers or overwrite a prior result. | Check identity before enqueueing and reject active or available completed matches. |
| A completed file is removed outside the app | The manager can show a completed record with no usable media. | Check file availability and route the row to missing-file recovery. |
| A queue action ignores row state or an existing pending action | A transfer can receive an unsafe or overlapping command. | Gate each action by the row status and pending ID. Do not open catch-up rows from the queue. |
| A provider playlist is removed after a download completes | The local file remains but live-provider navigation cannot resolve a target. | Keep the offline detail available and show the provider handoff only when its source playlist exists. |
| A catalog detail handoff is applied to a different item or route | The detail view can show the wrong provider-only state or return destination. | Match handoff state to the selected identity and clear consumed state when the identity or route changes. |
| An item action is repeated before the first action finishes | The same download can receive overlapping pause, retry, play, reveal, or remove requests. | Track pending download IDs and block actions until the current operation ends. |
| A download removal or clear operation is canceled or fails | The user can assume terminal records were removed when they remain in the manager. | Require confirmation before destructive changes, keep the clear operation busy until it ends, and show the action or recovery error. |
| Cleanup cannot finish without manual file recovery | The manager cannot safely claim that the record or partial data was removed. | Show the recovery path in a persistent dialog and let the user copy it before retrying cleanup. |
| A series dialog uses stale group membership | An episode can remain actionable after it is removed or can show the wrong episode count. | Feed the dialog the current group members and disable actions for the exact pending episode. |
| Provider metadata or TMDB enrichment is unavailable | The offline detail may have less data, but it must remain usable. | Keep the saved or locally derived snapshot and persist only a valid completed refresh. |
| Provider metadata uses a field shape that the snapshot mapper does not recognize | The offline detail can lose its title, artwork, credits, duration, or provider category context. | Normalize provider fields through the source-aware mapper and fall back to the saved snapshot for missing values. |
| Two metadata refreshes finish out of order | An older result can replace newer offline metadata. | Group refreshes by download or series identity and persist only the latest generation. |
| A recording update event is missed while a capture changes state | The manager can show stale recording status or file size. | Subscribe before the initial load and refresh active recordings on a short interval. |
| A recording file is missing or a recording fails | The item appears ready when it cannot be played, or the user expects a re-download that cannot recreate the broadcast. | Move it to Needs attention, refresh after file-action errors, and offer removal rather than re-download. |
| A recording action is repeated before the first action finishes | The same local capture can receive overlapping stop, play, reveal, or remove requests. | Track pending recording IDs and block actions until the current operation ends. |
A recording filter includes attention or library rows in in-progress | The user sees rows that do not match the filter and the page no longer reflects its label. | Keep in-progress limited to recording status and hide recordings from movie and series filters. |
| A recording is removed while its detail route is open | The detail page can point to an item that no longer exists. | Use the authoritative recording list to return to the downloads workspace. |
Key files
| File | Why to read it |
|---|---|
| libs/…/portal-catalog-facade.ts | Defines the common catalog capabilities and provider boundary. |
| libs/…/unified-recent-data.service.ts | Combines recent playback from all portal types and coordinates scoped playback removal, clearing, and archive-aware UI updates. |
| libs/…/history-archive-notification.spec.ts | Verifies that an archive-aware recent-playback update refreshes the UI without replacing retained history. |
| libs/…/catalog-sort-options.ts | Defines the shared sort choices and the labels shown for active refinements. |
| libs/…/category-content-view.component.ts | Shows the shared category, refinement, selection, paging, portal-readiness, handoff, error, and return flow. |
| libs/…/category-content-view.component.html | Shows the catalog header, refinement menus, progress states, grid, and append retry surface. |
| libs/…/category-infinite-scroll-snapshot.cases.ts | Shows the contract for saving and restoring the grid position across detail navigation and view destruction. |
| libs/…/catalog-hide-watched.ts | Defines the optional hide-watched refinement state, retry, and automatic-loading controls. |
| libs/…/category-hide-watched.cases.ts | Verifies hide-watched readiness, retry, chip clearing, and the separate source has-more state. |
| libs/…/category-content-view.component.scss | Shows the sticky category header, responsive refinement layout, and separate catalog scroll area. |
| libs/…/category-content-view.component.spec.ts | Verifies loading copy, refinement behavior, route handoffs, first-load errors, playlist changes, stale navigation state, and scroll restoration. |
| apps/…/catalog-deletion.ts | Defines the safe, progress-aware removal of large portal catalogs. |
| apps/…/xtream.operations.ts | Shows how Xtream catalog replacement preserves favorites, hidden categories, and recently viewed items. |
| libs/…/xtream-catalog-facade.service.ts | Shows the Xtream catalog behavior and its rating support. |
| libs/…/stalker-catalog-facade.service.ts | Shows Stalker paging, progress, selection, and provider actions. |
| libs/…/search-results.component.ts | Shows in-portal and global search scope, filters, result windows, paging, and stale-request protection. |
| libs/…/search-results.component.html | Shows global grouping, portal filters, hidden-category filtering, and result rendering. |
| libs/…/stalker-search-paging.controller.ts | Shows Stalker search paging, deduplication, retry behavior, portal identity, and parental-lock filtering. |
| libs/…/stalker-search.component.html | Shows the Stalker search surface and explicit append retry. |
| libs/…/category-management-dialog.component.html | Shows Xtream category visibility and parental-lock controls. |
| libs/…/stalker-category-lock-dialog.component.html | Shows Stalker category search, bulk lock actions, and save flow. |
| libs/…/xtream-content-gate.component.ts | Shows the boundary between blocked content initialization and routed catalog content. |
| libs/…/xtream-cached-offline-notice.component.ts | Shows how an initialized cached catalog reports provider loss and retries source status. |
| libs/…/vod-details-route.component.ts | Shows how Xtream detail actions choose provider playback or local media and expose download actions. |
| libs/…/vod-details-route.component.html | Shows the offline-first detail actions and provider fallback controls. |
| libs/…/vod-details-downloads.service.ts | Shows how an Xtream VOD becomes a download request. |
| libs/…/vod-details-playback.service.ts | Shows how provider playback, resume state, and source identity stay aligned. |
| libs/…/stalker-vod-download.ts | Shows Stalker source-link resolution before download. |
| libs/…/season-download-coordinator.service.ts | Shows the common rules for one episode and batch episode submissions. |
| libs/…/downloads.service.ts | Defines the renderer-facing download state and actions. |
| libs/…/downloads.component.ts | Coordinates portal scope, filters, counts, queue and library surfaces, series dialogs, and offline navigation. |
| libs/…/downloads.component.html | Shows how recording and provider download queues and libraries share the workspace. |
| libs/…/download-manager.viewmodel.ts | Defines portal scoping, queue and attention groups, filter behavior, counts, and library grouping for provider downloads. |
| libs/…/download-queue.component.ts | Shows queue sections, missing-file status, action limits, pending-action protection, and progress display. |
| libs/…/download-queue.component.html | Shows download state actions, missing-file recovery, source labels, and row details. |
| libs/…/download-library.component.ts | Shows library entities, series episode access, catch-up playback, and pending actions. |
| libs/…/download-library.component.scss | Shows the poster-card library layout and the responsive presentation of downloaded media. |
| libs/…/download-manager-actions.service.ts | Coordinates download actions, pending state, scoped clearing, confirmations, file errors, and cleanup recovery. |
| libs/…/downloaded-series-dialog.component.ts | Defines the live episode list and per-episode action contract for a downloaded series. |
| libs/…/downloaded-series-dialog.component.html | Shows episode identity, local size, and available local-file actions. |
| libs/…/download-offline-detail.component.ts | Shows how an offline download becomes a movie or series detail view and can return to a provider. |
| libs/…/download-offline-detail.component.html | Shows the local detail surface for available movies and grouped series episodes. |
| libs/…/download-offline-metadata.service.ts | Resolves offline metadata from saved, provider, and optional TMDB sources. |
| libs/…/download-metadata.mapper.ts | Normalizes Xtream and Stalker metadata into the offline snapshot and preserves fallback data during enrichment. |
| libs/…/recordings.service.ts | Defines the renderer-facing recording list, runtime updates, and local recording actions. |
| libs/…/recording-manager.viewmodel.ts | Defines recording visibility, filters, scoped counts, search, duration, and library grouping. |
| libs/…/recording-manager-actions.service.ts | Coordinates recording stop, play, reveal, and remove actions with pending-state and error handling. |
| libs/…/recording-detail.component.ts | Shows the focused recording view, detail actions, return behavior, state display, and guide-time display. |
| libs/…/recording-detail.component.html | Shows recording state actions and covered guide programs. |
| libs/…/recording-queue.component.html | Shows active recording and attention views. |
| libs/…/recording-library.component.html | Shows the ready recording library and its local-file actions. |
| apps/…/download-requests.ts | Shows the desktop boundary where requests are authorized, deduplicated, persisted, and queued. |
| apps/…/download-runtime.ts | Shows the transfer queue and status lifecycle. |