Introducing a new way to review your PRs.

Read the announcement

4gray / iptvnator

:tv: Cross-platform IPTV player application with multiple features, such as support of m3u and m3u8 playlists, favorites, TV guide, TV archive/catchup and more.

View on GitHub

26 documents · Updated Nov 23, 2026

docs / shared-state-services-and-data

Shared state, services, and data

The shared foundation gives the renderer, desktop process, browser runtime, self-hosted storage, and database one set of application contracts. It keeps source data, playback context, user activity, favorites, settings, and protected-content rules consistent while each runtime uses the capabilities that it supports.

Cross-runtime contract

The cross-runtime contract gives the application one vocabulary for data and requests that cross process or runtime boundaries. Shared interfaces describe playlists, channels, EPG data, settings, playback positions, downloads, recordings, player sessions, activity, favorites, and bridge results. ElectronBridgeApi defines the native capabilities exposed to the renderer in libs/…/electron-api.interface.ts.

The contract also carries stable names for IPC commands and content or playlist types. This keeps the renderer and native side aligned when they exchange portal requests, database work, playback actions, download and recording updates, window events, or shared activity operations. Optional bridge members mark features that older desktop builds may not support, so the service layer can treat a missing capability as unavailable instead of calling a partial contract. Portal cancellations and expected authentication refusals use a shared failure shape. Player sessions use shared status and error codes, so the UI can show a useful message without exposing raw player output as the product contract.

The same boundary defines playlist documents for desktop and self-hosted storage. A document store can keep the full playlist payload while exposing metadata needed for fast source lists. User data in the browser also has a replaceable storage contract, which lets server-backed web mode use the same service behavior as local browser storage. The server contract fixes the API version, supported Xtream user-state areas, payload-preserving writes, instance identity, access challenge, conflict responses, and activity routes. These rules let a browser distinguish an access failure from a provider error and prevent one server or browser copy from silently replacing another.

Hosted-server interfaces extend this boundary to server control and device access. They describe local, HTTPS, proxy, and Cloudflare operating modes, server status, device approval commands, and worker messages without making each client invent its own status or command vocabulary. libs/…/hosted-server.interface.ts is the shared contract for those controls.

References: libs/…/electron-api.interface.ts• L69-128 libs/…/electron-api.interface.ts• L618-709 libs/…/portal-request-failure.util.ts• L1-25 libs/…/external-player-session.interface.ts• L3-21 libs/…/server-storage.contract.ts• L1-87 libs/…/activity-sync.wire.ts• L13-39 libs/…/favorites-sync.contract.ts• L1-115 libs/…/source-api.ts• L16-57 libs/…/hosted-server.interface.ts• L1-143

Application state

The m3u-state library is the shared NgRx state boundary for M3U-style workspace state. It represents the active channel and playback URL, channel loading, EPG selection, playlist metadata, favorites, and selected filters so views can read a common state instead of keeping separate copies.

Actions describe user or system changes. Reducers update local state, selectors expose derived views, and effects connect those changes to persistence, EPG loading, navigation, and external players. Durable changes go through the services layer rather than writing to storage from a component. Some actions only publish data that an awaited owner already persisted, so state hydration does not repeat the write.

Playlist inventory readiness is explicit. A failed load or replacement stays unready until a later load succeeds, and an authoritative shared-source load can replace stale metadata without discarding the already-open playlist payload.

The following diagram shows how state events move through local state and shared services.

flowchart LR
    UI[Workspace views] --> A[State actions]
    A --> R[Reducers]
    R --> S[Selectors]
    S --> UI
    A --> E[Effects]
    E --> PS[Playlist and data services]
    E --> ES[EPG and player services]
    PS --> B[Runtime bridge or document store]
    B --> D[SQLite, IndexedDB, or server storage]

References: libs/…/state.ts• L6-26 libs/…/actions.ts• L10-113 libs/…/selectors.ts• L7-110 libs/…/effects.ts• L281-317 libs/…/effects.ts• L365-509 libs/…/playlist.reducers.ts• L12-143

Playlist and channel state

Playlist state combines the current channel experience with lightweight playlist metadata. The entity map keeps source metadata without a second copy of the channel payload, while the active playlist keeps its channels available for live browsing and playback.

The state actions cover playlist loading and updates, channel selection, EPG playback, favorites, and filters. Playlist additions are serialized so every accepted source receives its EPG work and navigation. Metadata updates can also publish a change that was already persisted by an awaited owner without writing it a second time. Shared playlist hydration and committed removal make the same distinction clear for server-backed source projections: one action rehydrates a persisted document, while another records that deletion has already been accepted.

Shared playlist loading has two meanings. A normal load adds the known inventory, while an authoritative load replaces it and removes sources no longer present. Shared hydration updates an existing source and does not recreate a source that a later deletion removed.

Refresh data is accepted only when it still belongs to the current source. The reducer keeps detected, manual, enabled, and disabled EPG source choices distinct. It also keeps user activity and source settings when new channel data arrives. A delayed refresh cannot replace a newer source URL or request identity.

References: libs/…/actions.ts• L10-65 libs/…/effects.ts• L281-317 libs/…/effects.ts• L365-477 libs/…/effects.ts• L479-509 libs/…/playlist.reducers.ts• L21-143 libs/…/playlist-refresh.effect.spec.ts• L12-89 libs/…/playlist.reducers.spec.ts• L10-170

EPG and playback state

EPG state links the active channel to its current and selected program. Effects request channel programs, resolve catch-up playback, and return to live playback when the user leaves an archived program.

The EPG display offset corrects provider times for the user without changing provider timestamps in stored rows, catch-up URLs, or recording snapshots. Consumers either shift program times for display or shift the current clock for decisions over raw program times. One comparison must not apply both forms.

Xtream sources add a server clock contract. Account information provides the panel timezone and clock. The service stores a validated value with the playlist and uses it for provider time strings and catch-up requests. A source change clears the learned timezone until the new panel reports its own clock.

References: libs/…/actions.ts• L85-97 libs/…/effects.ts• L145-205 libs/…/epg-display-offset.util.ts• L1-21 libs/…/xtream-server-timezone.util.ts• L39-149 libs/…/catchup.utils.ts• L8-60

Shared playback activity

Shared playback activity is an opt-in, versioned record of resume state, watched state, and active playback ownership for a verified self-hosted source. It lets devices in one source scope share activity without making provider ids alone the identity of a title.

The client commits each local change before it sends a server operation. A local outbox then delivers the ordered operations when consent, source identity, and connectivity still match. Local mutations are serialized, and explicit actions fence older launches and their failure fallbacks so a late player callback cannot reclaim newer ownership. The same local projection is stored in IndexedDB for the PWA or through an Electron transaction for desktop windows, so a reload or sibling window can recover pending work.

The protocol separates a playback session from a checkpoint. A session claims ownership with a generation, while checkpoints advance with ordered sequence numbers and capture times. A newer native checkpoint can supersede an older pending web checkpoint. Delivery claims the current outbox record rather than trusting an old list snapshot, and a fresh checkpoint conflict retires that session instead of creating a second stale conflict. A fresh launch can rebase a bounded number of pending operations against the current server state. Revision, session, and sequence conflicts still stop automatic delivery or trigger the explicit local-or-server resolution path.

Activity identity includes the provider and the content kind. Episode identity also includes its series and provider-specific episode scope, so a local catalog id can change without changing the shared title. Imported playback positions normalize fractional player values to whole protocol seconds. Historical native rows may omit optional duration or series fields, and a Stalker zero-duration episode reset remains a reset rather than a resume point.

The following diagram shows how a playback change becomes local state and then shared source activity.

flowchart LR
    Player[Player event] --> Client[Activity sync client]
    Client --> Local[Local projection and outbox]
    Local --> Runtime[IndexedDB or Electron local store]
    Local -->|consent and current source| Apply[Source activity operation]
    Apply --> Server[Verified self-hosted server]
    Server -->|applied or conflict| Local
    Local --> Views[Playback and history views]

Explicit actions supersede older launches. Consent changes stop delivery for the old generation, and local mutations drain before opt-out completes. Delivery leases prevent two windows from sending the same head operation at once, while a renderer change event only invalidates views; the durable local record remains the source of truth. If a launch fails before it gains shared ownership, later player callbacks remain local until a new explicit launch or a verified durable owner makes them safe to share.

References: libs/…/activity-sync.contract.ts• L1-115 libs/…/activity-sync.reducer.ts• L20-118 libs/…/activity-sync.wire.ts• L13-39 libs/…/activity-action-fence.ts• L8-79 libs/…/activity-projection.ts• L8-115 libs/…/activity-sync-client.ts• L71-133 libs/…/activity-sync-client.ts• L224-273 libs/…/activity-sync-sessions.ts• L21-142 libs/…/activity-sync-sessions.ts• L145-335 libs/…/activity-delivery-response.ts• L11-129 libs/…/activity-sync-resolution.ts• L18-211 libs/…/activity-native-nullables.sqlite.spec.ts• L40-117 libs/…/activity-checkpoint-order.spec.ts• L13-148 libs/…/activity-sync-client.spec.ts• L127-228 libs/…/memory-activity-store.ts• L9-53 libs/…/indexeddb-activity-local.ts• L13-59 libs/…/electron-activity-local.ts• L9-59

Shared favorite state

Shared favorite state is an opt-in membership record for a source and content identity. It lets several runtimes share favorite membership while keeping the playlist projection usable offline and keeping playback sessions and resume ownership outside this domain.

An explicit favorite action updates the local projection first and adds an ordered server intent. The intent carries the verified source incarnation, consent generation, expected revision, and typed content reference. Delivery stops when the profile, source, or consent changes. A conflict remains visible until the user chooses the local or shared value.

The local record is separate from the legacy playlist favorite fields. Browser clients use a source-scoped IndexedDB store, while Electron windows use a compare-and-commit local store so sibling windows do not overwrite one another. A small playlist bridge lets ordinary local writes keep working when shared favorites are not active; when the shared domain accepts an action, the bridge prevents a second legacy write.

The following diagram shows how a favorite action moves from a playlist view to a shared source and back to local views.

flowchart LR
    View[Favorite action] --> Bridge[Playlist favorite bridge]
    Bridge --> Local[Local projection and intent]
    Local --> Store[IndexedDB or Electron local store]
    Local -->|verified source and consent| Server[Self-hosted source]
    Server -->|applied or conflict| Local
    Local --> Projection[Playlist and favorite views]

Source replacement retires the old favorite context before a new source incarnation can reuse the source id. Cached contexts are also shared across tabs, so a stale offline edit cannot authorize delivery to a replacement source.

References: libs/…/favorites-sync.contract.ts• L1-115 libs/…/favorites-sync.reducer.ts• L20-118 libs/…/favorites-events.ts• L3-43 libs/…/favorites-sync-client.ts• L31-78 libs/…/favorites-sync-client.ts• L154-245 libs/…/favorites-sync-delivery.ts• L19-90 libs/…/indexeddb-favorites-local.ts• L13-59 libs/…/electron-favorites-local.ts• L9-59 libs/…/favorites-source-contexts.ts• L46-113 libs/…/playlist-favorites.ts• L16-52

Service layer

The services library is the application-facing layer for work shared by views or runtimes. It owns playlist persistence and refresh, settings, portal status, playback positions, downloads, recordings, backups, source synchronization, enrichment, activity synchronization, favorites synchronization, and runtime adapters.

Services hide whether a task uses browser storage, SQLite through the Electron bridge, a self-hosted server contract, a portal request, or a runtime-only feature. They return an explicit unavailable or failure result when a runtime cannot support the task instead of making each feature learn bridge details.

Playlist lifecycle

PlaylistsService is the central owner of playlist data. It parses M3U input, stores playlist metadata and content, manages local favorites and recently viewed items, and keeps refresh-owned data separate from user-owned choices such as ordering and hidden groups.

The service selects IndexedDB or a desktop or server document store through PlaylistStorageBackend. A full playlist document supports source content and metadata together, while metadata reads support fast source lists. Startup migrations keep older playlist rows readable across storage changes, including legacy Stalker metadata. All read-modify-write changes for one source are ordered together. This includes refresh, favorites, history, portal session updates, and deletion, so a late operation cannot restore stale data or resurrect a removed source.

Explicit favorite mutations pass through FAVORITES_PLAYLIST_BRIDGE when shared favorite synchronization is active. This keeps the visible playlist projection and the shared local intent under one owner. Legacy or inactive paths still persist the playlist favorite field directly.

Recently viewed mutations use a source-appropriate identity. M3U items match by stream URL, while portal items also respect content kind and series mode when ids can repeat. A touch moves the item to the front and keeps earlier fields that the new event does not provide.

Refresh follows a simple ownership rule: provider data can replace the parsed catalog, while current source identity and device activity remain authoritative. A refresh whose source identity no longer matches is ignored. Deletion commits before cleanup runs, and cleanup warnings do not recreate the deleted source. A whole-library reset also waits for active writes and blocks new writes until the reset completes.

References: libs/…/playlists.service.ts• L84-125 libs/…/playlists.service.ts• L390-467 libs/…/playlists.service.ts• L534-743 libs/…/playlists.service.ts• L774-1109 libs/…/playlists.service.ts• L1318-1367 libs/…/playlist-history.ts• L15-141 libs/…/playlist-history.spec.ts• L27-145 libs/…/favorites-events.ts• L3-43 libs/…/playlist-refresh-merge.ts• L15-85 libs/…/playlists.service.spec.ts• L1252-1337

Self-hosted source synchronization

Source synchronization gives a selected self-hosted server authority over shared source definitions while each runtime keeps local playlist content and activity. The server shares source identity, connection details, titles, and revisions. The client materializes those definitions into local documents and retains device-specific favorites, history, EPG choices, and negotiated sessions.

The source connection is verified by server instance identity before the client sends provider credentials or source mutations. Credentials are revoked when a transport failure, server outage, invalid response, or instance replacement invalidates the proof; a logical revision conflict remains a conflict instead of becoming an outage. Conditional revisions protect source edits from lost updates. Shared activity and shared favorites use the same verified connection but separate context, list, read, and apply requests. Local activity and favorite state are never sent as part of a source definition.

Browser connection state keeps the selected server address separate from the tab token. A disconnected browser can retain a known address and token for an explicit reconnect, while a forgotten connection removes both. Discovery and connection operations do not overwrite a newer connect or disconnect, and a server instance change cannot reuse an old token.

Hosted browser deployments can also recover a native pairing. The bridge first verifies that the configured backend is the same-origin /api endpoint and that its instance advertises the required source-sync capability. It then asks the host for a short-lived credential and accepts it only when the reply has the expected token shape. Forgetting the pairing uses the same host bridge and reports success only after the host confirms removal.

Source materialization can keep a URL source pending when its content cannot be fetched. A later retry can fill the local catalog without changing the server revision. The cached library remains readable during an outage, but source mutations wait for a verified connection. Canonical source ids returned by the server are adopted before local activity or favorite state is merged, and source cleanup retires old sidecar contexts before an id can be reused.

References: libs/…/source-api.ts• L16-65 libs/…/source-api.ts• L67-216 libs/…/source-browser-settings.ts• L14-174 libs/…/source-connection.ts• L7-152 libs/…/source-connection.ts• L223-245 libs/…/hosted-pairing-bridge.ts• L1-85 libs/…/source-authorization.ts• L15-71 libs/…/source-sync.service.ts• L77-155 libs/…/source-sync.service.ts• L157-365 libs/…/synced-playlist-store.ts• L29-103 libs/…/synced-playlist-store.ts• L131-231 libs/…/favorites-source-contexts.ts• L46-113

Settings and runtime capability

SettingsStore is the shared source for user preferences. It loads defaults, normalizes saved values, exposes current settings to application services, and records load or save failures so the UI can distinguish defaults or in-memory changes from durable storage.

Boolean features that default on use an explicit false opt-out. This preserves the default for older settings records while rejecting malformed values as the default. Nested settings such as dashboard rails also merge with their enabled defaults, so a partial older record does not remove newer choices. A settings save persists the complete normalized settings object before it reconciles dependent EPG state. A failed save reports the failure and restores the previous EPG URL and enabled state; other in-memory settings remain visible until a later load or save resolves the storage issue.

Settings writes preserve unrelated values that may have changed in another tab. In particular, a TMDB key transfer compares the key that the caller expects with the key in the committing transaction, and a cross-tab notice refreshes the key without replacing unrelated settings. This keeps credential transfer from overwriting a newer key or a separate preference update.

EPG preference changes use the latest successfully committed settings. An older enable or disable operation cannot apply its native result over a newer successful save, while an unsuccessful later save does not retire the earlier committed preference. EPG source cleanup runs only after persistence succeeds, and an explicit retry can rerun a failed cleanup without reconciling unrelated settings changes.

The saved embedded MPV choice is checked against the current machine. An inconclusive support result keeps the choice for a later check, while a final unsupported result or failed check returns to the default player. Preparation runs when the runtime is idle and does not replace a player that the user selected while the check was in progress.

RuntimeCapabilitiesService describes feature groups available in Electron or PWA mode. Each group checks the complete contract that its service needs, so an older desktop bridge is treated as unavailable instead of failing halfway through an action. Favorites, activity, Xtream catalog storage, playback positions, EPG, downloads, recordings, parental filtering, window controls, and other desktop features can therefore select a safe browser or in-memory path, or fail closed when no safe path exists. Ordinary playback-position work and atomic backup restore use separate checks, so a partial bridge does not disable unrelated reads or writes. Provider EPG can use the browser service path, while desktop-only provider catch-up remains unavailable in the PWA.

References: libs/…/settings-store.service.ts• L45-212 libs/…/settings-store.defaults.ts• L25-211 libs/…/settings-opt-out.util.ts• L10-48 libs/…/settings-storage.ts• L9-89 libs/…/settings-store.embedded-mpv.ts• L3-87 libs/…/epg-preferences.service.ts• L18-70 libs/…/epg-source-settings.service.ts• L27-181 libs/…/runtime-capabilities.service.ts• L24-42 libs/…/runtime-capabilities.service.ts• L118-228 libs/…/runtime-capabilities.service.ts• L244-322 libs/…/runtime-capabilities.service.ts• L357-402 libs/…/settings-store.service.spec.ts• L871-978

Parental lock

Parental lock is a shared content policy that withholds protected groups and categories until a parent enters a PIN. It applies to M3U groups, Stalker categories, and Xtream categories, so the same policy follows the content source instead of living in one view.

The hashed PIN and per-playlist lock lists are stored separately from general settings. Electron stores them through the shared database bridge, while the PWA uses browser storage scoped to the active source profile. The unlocked state exists only for the current session. An idle timeout or explicit lock returns the application to the protected state.

The service fails closed when lock data or its storage contract cannot be trusted. Playlist deletion removes lock data. Backup restore treats lock lists as protected user state and requires a PIN before it can replace existing locks.

References: libs/…/parental-lock.service.ts• L45-59 libs/…/parental-lock.service.ts• L95-257 libs/…/parental-lock-storage.ts• L12-110 libs/…/parental-lock-bridge.ts• L9-69

EPG preferences and source settings

EPG preference state separates the committed user choice from transport state. EpgPreferencesService disables work before an opt-out is saved, waits for startup hydration, and rejects late results from an older enable or disable revision.

EpgSourceSettingsService turns committed global XMLTV source settings into shared source state and native database data. It normalizes and de-duplicates saved URLs, reconciles the global list with playlist-owned M3U sources, and fences in-flight lookups so an old result cannot replace data for a newer setting. Active source URLs remain available while migration or cleanup is in progress. A failed reconciliation is retained for an explicit retry instead of being reported as complete. Settings storage failure does not reconcile the default empty state as if it were a saved source list.

References: libs/…/epg-preferences.service.ts• L18-111 libs/…/epg-source-settings.service.ts• L27-181 libs/…/settings-store.service.ts• L81-232 libs/…/settings-opt-out.util.ts• L1-48

Database access

The shared database library defines the SQLite data model and connection rules used by the desktop backend and read-only agent access. It stores playlist sources, provider catalogs, EPG data, activity, playback positions, downloads, recordings, enrichment data, source pins, category visibility, and local favorite synchronization records.

DatabaseService presents renderer-facing operations through the native bridge or a document store. Long catalog work has an operation identity with progress, cancellation, and a distinct abort result. Event listeners belong to one operation and are removed when that operation settles. Reads used for recovery or backup keep a failed read separate from an empty collection.

Category visibility has two meanings. Normal catalog work can update the current view. An explicit user choice also needs native acknowledgment so a restore or later refresh does not confuse a transient view with durable intent. Deferred Xtream history is cleared only after the matching native deletion succeeds. Favorite local state follows a separate compare-and-commit path so it can be shared by windows without becoming server-owned source metadata.

Data areaProduct purpose
Playlists, categories, contentKeep imported sources and provider catalogs available offline.
Favorites and recently viewedBuild playlist-scoped and global activity views.
Shared favorite recordsKeep verified source-scoped favorite intent across runtimes.
EPG channels and programsSupport live schedules, lookup, search, and catch-up.
Playback positionsResume movies and episodes across sessions.
Downloads and recordingsTrack local media files and their progress.
Enrichment and source pinsReuse metadata and remember a preferred VOD source.

References: libs/…/README.md• L3-54 libs/…/schema.ts• L25-212 libs/…/database-electron.service.ts• L119-259 libs/…/database-electron.service.ts• L646-709 libs/…/database-electron.service.ts• L958-1004 libs/…/electron-favorites-local.ts• L9-59

Playback positions and downloads

Playback position services preserve resume state for VOD and episodes. Ordinary reads and writes can use a best-effort path when storage is unavailable. Backup restore uses a failure-propagating read and atomic replacement path, so an IPC failure cannot look like an empty position list and erase valid data.

Downloads provide a desktop-only managed file flow. The service exposes reactive download state, starts or controls downloads through the native process, and checks that a completed file is still available before it offers playback. It returns a clear unavailable result outside Electron.

References: libs/…/playback-position-runtime-bridge.service.ts• L60-100 libs/…/playback-position.service.ts• L74-162 libs/…/downloads.service.ts• L16-165 libs/…/runtime-capabilities.service.ts• L270-294

Live-TV recordings

Live-TV recordings provide a desktop-only flow for saving a channel stream to a local file. RecordingsService keeps one current list for the renderer, reflects changes from the native process, and exposes actions to stop, remove, play, or reveal a recording.

Recording metadata is captured when recording starts because provider EPG data may not remain available later. A clean stop can add programs that overlap the recorded interval. An implicit stop keeps the start snapshot, so the record still has the channel and program context known before the interruption.

References: libs/…/recordings.models.ts• L1-14 libs/…/recordings.service.ts• L12-160 libs/…/recording-metadata.interface.ts• L1-82 libs/…/recording-program-overlap.util.ts• L1-63

Portal status and host health

PortalStatusService gives shared consumers a consistent view of Xtream account health. It identifies a connection by normalized address, credentials, and User-Agent. It shares short-lived results and joins concurrent passive checks, while an explicit connection test can publish fresher evidence.

The host health guard protects portal requests from repeated waits on a host that does not answer. It counts connection-level failures by scheme, host, and port. It fast-fails for a short period, permits one trial when the period ends, and lets an explicit user retry reset old evidence. A normal HTTP response is not evidence that the host is dead.

References: libs/…/portal-status.service.ts• L16-29 libs/…/portal-status.service.ts• L65-189 libs/…/xtream-connection-test.service.ts• L14-135 libs/…/host-connectivity-guard.ts• L1-32 libs/…/host-connectivity-guard.ts• L202-376

Backup and restore

PlaylistBackupService provides a versioned export and restore contract for M3U, Xtream, and Stalker sources. It carries source connection data beside user state such as favorites, history, hidden categories, playback positions, EPG choices, source pins, and parental locks.

Restore validates the complete manifest before the first storage write. It matches an archive entry to an existing source by stable source identity, then imports or merges it under the accepted playlist id. Complete collections are authoritative. An absent optional field means no opinion, so an unavailable store or older archive does not clear valid local data. Backup EPG settings merge with existing settings by source identity; remote URLs use a normalized URL identity, while local path spelling remains unchanged.

Xtream sources can carry source pins and a catalog that is not loaded. The restore parks unresolved category and history identities, applies the data that current catalogs can prove, and consumes only the entries confirmed by the native or browser restore result. A newer restore keeps ownership of the parked state. Source pins are replaced as one collection when the archive states them, while an unavailable pin store omits the field rather than claiming that the collection is empty. This allows export, retry, and source refresh to recover data without treating dormant state as a failed active import. Favorite restores also preserve a saved target id when an earlier entry fails, so a later entry cannot overwrite the wrong source.

The PWA writes required favorites, history, and playback lists before optional title snapshots. Each list keeps a receipt for unfinished restore work, so a retry skips only the lists that were confirmed. Server-backed storage keeps the receipt with the browser cache and removes it only after the server confirms the restored lists. Explicit user edits shrink archive-owned favorite entries and do not restore that ownership when a user adds the item again. An unreadable receipt fails closed rather than replaying an uncertain restore.

The PWA uses browser user-data storage instead of SQLite. Typed provider identities keep live, movie, and series entries distinct. Native Android playback checkpoints are invalidated with the restored playlist position list, and a failed write does not stamp a reset. Optional title snapshots are used only when their saved identity matches the durable favorite or history entry. Playback positions are exported as local snapshots, without live player ownership or session ids.

The following diagram shows how a backup moves through validation, source matching, and runtime-specific restore.

flowchart LR
    Source[Playlists and user state] --> Export[Versioned manifest]
    Export --> Validate[Validate before writes]
    Validate --> Match[Match or create source]
    Match --> Desktop[SQLite and native state]
    Match --> Browser[Browser user-data storage]
    Browser --> Receipt[Per-list restore receipt]
    Receipt -->|server confirmed| Apply[Apply proven state]
    Desktop --> Park[Park unresolved catalog state]
    Park --> Apply
    Browser -->|playback list write| Reset[Invalidate native checkpoint]

Exports fail when protected lock data cannot be read. Restore asks for the parental PIN before it replaces lock state and asks again if a long restore crosses a session relock. This keeps an unreadable or unapproved lock change from looking like a successful backup.

References: libs/…/playlist-backup.service.ts• L106-171 libs/…/playlist-backup.service.ts• L197-315 libs/…/playlist-backup.service.ts• L427-597 libs/…/playlist-backup.service.ts• L837-951 libs/…/playlist-backup.service.ts• L1118-1134 libs/…/playlist-backup.service.ts• L1133-1215 libs/…/playlist-backup.service.ts• L1263-1351 libs/…/playlist-backup.service.ts• L1412-1530 libs/…/playlist-backup-epg.ts• L3-24 libs/…/playlist-backup-validation.ts• L16-126 libs/…/playlist-backup-playback-position.ts• L28-60 libs/…/pwa-xtream-backup-storage.ts• L37-70 libs/…/pwa-xtream-backup-storage.ts• L141-250 libs/…/pwa-xtream-backup-storage.ts• L252-349 libs/…/pwa-xtream-restore-progress.ts• L24-123 libs/…/pwa-xtream-restore-progress.ts• L125-225 libs/…/pwa-native-playback-resets.ts• L1-55 libs/…/xtream-user-data-keys.ts• L18-117 libs/…/pwa-xtream-backup-storage.progress.spec.ts• L73-117 libs/…/pwa-xtream-backup-storage.progress.spec.ts• L266-343 libs/…/pwa-xtream-backup-storage.progress.spec.ts• L575-620

Xtream catalog refresh

Xtream catalog refresh replaces only the selected catalog types and leaves unchanged or disabled types intact. It fetches the new provider data before deleting the old cache, checks that the source connection is still the accepted one, and reports progress for the active catalog.

The refresh first parks favorites, history, category choices, and recovery markers. It then replaces categories and content in stages. A failed or interrupted stage is marked incomplete and cleared before a retry, while retained user state stays available for later recovery. The same boundary supports explicit catalog visibility and backup restore, so a partial catalog cannot silently consume history or overwrite a newer source edit.

References: libs/…/xtream-selected-catalog-refresh.service.ts• L52-181 libs/…/xtream-selected-catalog-refresh.service.ts• L184-365 libs/…/xtream-catalog-commit.service.ts• L8-84 libs/…/xtream-catalog-availability.ts• L7-25 libs/…/xtream-catalog-history-recovery.ts• L27-118

Cross-playlist discovery and TMDB enrichment

Cross-playlist discovery finds related titles across imported Xtream portals. TMDB enrichment adds editorial data, classifications, seasons, cast, trailers, and discover results without replacing provider-owned stream identity or playable fields.

Automatic matching preserves provider title text for remote searches and uses normalized text only for comparison. The application can also store a manual provider-or-TMDB choice for one source item. That choice is scoped by provider, playlist, content type, catalog, and item identity, so one correction does not change a different title that happens to reuse an id.

Missing or failed provider metadata remains usable. Confirmed missing TMDB ids are remembered, while rate limits, authorization failures, server errors, and offline failures remain retryable. Season data merges by episode number and fills only missing editorial fields. An unmatched episode passes through with its provider data intact.

The service also supports product discovery views. Trending movie and TV results are merged by popularity and use a time-limited cache. Facet-based discovery reads a bounded set of popular pages and keeps its results in session memory. These browse results do not become provider catalog data.

References: libs/…/tmdb-enrichment.service.ts• L24-125 libs/…/tmdb-match.service.ts• L5-107 libs/…/tmdb-discover.service.ts• L17-101 libs/…/tmdb-trending.service.ts• L12-109 libs/…/tmdb-cache.service.ts• L11-20 libs/…/tmdb-merge.ts• L28-34

VOD detail adapters

The shared VOD detail adapters give Xtream and Stalker responses one display model. They choose usable provider fields, parse release years consistently, and keep provider stream data separate from optional TMDB enrichment.

Provider placeholders such as N/A, -, blank text, and an unrated zero become absent values. Age-rating presentation uses the saved country when one is selected. TMDB classifications remain distinct from provider classifications, so display preferences do not change provider claims.

References: libs/…/age-rating-presentation.service.ts• L20-59 libs/…/tmdb-merge.ts• L125-292 libs/…/provider-metadata.util.ts• L16-59 libs/…/vod-details-adapters.ts• L16-207

Shared interface utilities

Shared interface utilities keep common user-facing views and playback decisions consistent across runtimes. foldSearchText gives in-memory filters a locale-independent comparison form, while recently viewed mapping converts stored M3U and Stalker activity into one activity shape.

Recently viewed mapping keeps source-specific routing and resume data. The workspace shell can therefore choose between local filtering, provider search, and Electron-only cross-playlist search without changing the stored activity contract.

Playback utilities apply the same rules in desktop, web, and TV clients. AutoplayStreak counts episodes started by autoplay and resets the run when the viewer starts one, while the up-next timing rule prefers known or detected closing credits and otherwise uses a bounded duration-based lead. Source presentation utilities use one provider classification and icon mapping, so source labels, filters, summaries, and dialogs agree for M3U, Xtream, and Stalker sources.

References: libs/…/search-text-fold.util.ts• L1-35 libs/…/playlist-recently-viewed.utils.ts• L17-138 libs/…/workspace-shell-search.service.ts• L41-176 libs/…/autoplay-streak.util.ts• L14-61 libs/…/up-next-timing.util.ts• L12-114 libs/…/source-type-icons.util.ts• L16-102

Browser, server, and translation utilities

The supporting utility contracts keep browser-only concerns replaceable and reactive. USER_DATA_STORAGE provides local or server-backed persistence for PWA user data. injectTranslationTick makes signal-based labels update when a language or dictionary changes.

The default user-data adapter reads browser storage inside each operation. This keeps storage denial inside the guarded read or write path. A self-hosted server can provide the same contract without changing backup or data-service behavior. Server mode keeps each namespace cache under the verified server instance, and it uses the same cache as the diff baseline when browser storage is full or unavailable. Restore receipts remain local metadata and are not sent as server playlist entries.

Clipboard copying has the same runtime-neutral goal for a small browser boundary. It uses the async browser API first, then a legacy copy path when focus rules reject the first request, and reports failure only when both paths fail. The fallback restores the prior focus so menus and dialogs do not lose their active control.

References: libs/…/user-data-storage.ts• L3-43 libs/…/translation-tick.ts• L6-31 libs/…/server-storage.contract.ts• L5-87 libs/…/server-migration.service.ts• L46-165 libs/…/server-user-data-cache.ts• L14-135 libs/…/server-user-data-receipts.ts• L9-35 libs/…/clipboard-copy.util.ts• L1-50

Server user-data synchronization

ServerUserDataStorage makes server-backed browser state behave like local storage while several page loads or devices can edit it. Synced data is grouped into named state areas and keyed by playlist id. Each changed entry is sent against the server version that the page read, so a concurrent change produces a merge path instead of a silent overwrite.

The service keeps unsent edits in memory and in browser storage. A reload can recover its own writes, while another live or closed page can adopt writes that would otherwise remain unseen. Conflict answers replay the recorded changes on the newer server value, and page-hide writes can outlive the page. The cache is scoped by server instance and namespace, so a tab connected to a different server cannot overwrite the old server's baseline. If browser storage refuses ordinary cache writes, the service can use a memory copy; restore receipts are stricter and fail rather than becoming memory-only state that could replay an old restore after reload.

The following diagram shows how local edits move through cache, version checks, and conflict replay.

flowchart LR
    Edit[Browser edit] --> Cache[Instance-scoped local cache]
    Cache --> Queue[Versioned write queue]
    Queue --> Request[Conditional server write]
    Request -->|saved| Cache
    Request -->|conflict| Replay[Replay edit on current value]
    Replay --> Queue
    Receipt[Local restore receipt] --> Cache
    Cache -->|restore confirmed| Clear[Compact receipt]

References: libs/…/server-user-data-storage.ts• L28-66 libs/…/server-user-data-storage.ts• L330-369 libs/…/server-user-data-queue.ts• L36-42 libs/…/server-user-data-queue.ts• L211-251 libs/…/server-user-data-journal.ts• L19-24 libs/…/server-user-data-cache.ts• L14-135 libs/…/server-user-data-receipts.ts• L9-35 libs/…/xtream-user-data-keys.ts• L21-105

Logging and diagnostics

The shared logging library makes diagnostics safer and more useful across runtimes. It redacts credentials from objects, URLs, query strings, and error text. It also limits depth and size so diagnostic output does not expose secrets or grow without bound.

Database tracing reports statement types instead of raw SQL. Renderer performance hooks report named phase events with stable ids, timestamps, item counts, and outcomes. Database parsing warnings avoid printing malformed payload contents.

References: libs/…/redact-sensitive-data.ts• L1-55 libs/…/redact-sensitive-data.ts• L194-245 libs/…/sql-trace-summary.ts• L1-58 libs/…/renderer-performance-phase.ts• L1-18 libs/…/connection.ts• L71-85

M3U data utilities

The shared M3U utilities convert playlist metadata into common application behavior. They create playlist objects, merge and select EPG sources, identify playback media types, detect likely M3U VOD entries, and build catch-up URLs.

Playlist EPG detection accepts remote URLs from provider headers. Local XMLTV paths remain user-owned input, so a downloaded playlist cannot make the importer read an arbitrary local file. When a playlist declares many sources, the utilities select a bounded useful set while keeping the full detected set available for later choice.

The utilities also turn Kodi playlist properties into typed DRM input. Unsupported or malformed DRM data remains an explicit unsupported result instead of causing a playback crash. These utilities are shared by parsing, state effects, and playback features so the same channel data produces the same decisions.

References: libs/…/playlist.utils.ts• L69-392 libs/…/kodiprop.utils.ts• L1-81 libs/…/dash.utils.ts• L1-18 libs/…/catchup.utils.ts• L19-60

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep shared bridge interfaces, IPC command names, runtime capability checks, and both bridge owners aligned when a cross-runtime operation changes.
  • Keep hosted-server commands, status states, operating modes, worker messages, and device results aligned across the Electron host, browser client, and hosted access flows.
  • Keep hosted pairing restricted to the verified same-origin API instance. Do not accept a token from a redirected endpoint, an invalid instance response, or an unvalidated host reply.
  • Keep each runtime capability group aligned with the full set of bridge methods required by its service. Keep ordinary playback checks separate from restore-only checks and from independent download or recording groups.
  • Keep default-on settings aligned across defaults, load normalization, partial updates, complete snapshots, and stored records. Only an explicit boolean false can opt out.
  • Keep nested settings defaults aligned when adding fields to dashboard rails or other grouped preferences, so partial stored records do not remove new defaults.
  • Keep settings read-modify-write behavior and TMDB key transfer checks aligned across tabs so a credential update cannot erase unrelated changes or replace a newer key.
  • Keep embedded MPV support results fenced to the saved player choice. An inconclusive probe must not force a fallback, and a late result must not replace a newer user choice.
  • Keep favorite addresses, provider and content identity, source incarnation, consent generation, local pending order, conflict resolution, and server operation handling aligned across PWA, Electron, and source-server paths.
  • Keep the favorites playlist bridge and the legacy playlist favorite field aligned so one explicit action does not persist twice or leave the visible projection stale.
  • Retire favorite contexts whenever source identity or source incarnation changes, including remote deletion and source-id reuse across tabs.
  • Keep activity address identity, source incarnation, consent generation, local outbox ordering, delivery leases, capture-time ordering, action fences, and server operation handling aligned across PWA, Electron, and source-server paths.
  • Keep activity session recovery separate from explicit launch ownership. A durable owner may recover a checkpoint, but an unknown player callback must not create a new shared launch.
  • Keep activity projection aliases and provider-specific identities aligned with import, reset, checkpoint, and backup handling. Preserve native null fields and Stalker reset semantics when converting between SQLite rows and protocol data.
  • Keep m3u-state actions, reducers, selectors, and effects aligned so authoritative loads, shared hydration, committed removal, and state-only updates have both the intended visible state path and the correct persistence path.
  • Keep the playlist entity map metadata-only and keep full channel payloads in the active or durable document path, so refresh publication cannot create duplicate channel state.
  • Keep refresh source matching aligned between m3u-state, playlist-refresh-merge, and PlaylistsService so a delayed payload cannot replace a newer URL, request identity, or user-owned state.
  • Keep recently viewed identity matching aligned for M3U URLs and typed portal content, especially when live, movie, and series ids overlap.
  • Preserve the distinction between source metadata, full playlist content, local activity, shared favorites, and server-owned source definitions when changing refresh or synchronization behavior.
  • Keep detected, manual, enabled, and disabled EPG source lists aligned across parsing, refresh, state hydration, and backup restore.
  • Keep backup EPG source identity rules aligned so remote URL normalization deduplicates equivalent sources without changing local path spelling.
  • Keep committed EPG preference revisions, successful settings persistence, failed-cleanup retry state, and native acknowledgments aligned so a late enable or disable result cannot revive stale work.
  • Keep per-playlist write ordering, whole-library reset ordering, migration state, and source-row snapshots aligned when a new playlist mutation can overlap refresh, deletion, or source projection.
  • Keep operation ids, operation names, progress events, cancellation results, and bridge method availability aligned for long database work.
  • Preserve the distinction between unavailable, empty, populated, parked, and proven collections in backup export and restore. For source pins, absent means no opinion, present empty means clear, and a failed read must fail rather than become either value.
  • Keep backup validation, source fingerprints, canonical target ids, pending receipts, deferred catalog state, native playback reset markers, native restore proofs, and atomic source-pin replacement aligned when user state changes.
  • Keep PWA restore receipts atomic with each required list. Preserve archive ownership only for untouched entries, and wait for server confirmation before compacting server-backed receipts.
  • Keep provider connection failures distinct from logical source revision conflicts. Revoke authorization after an invalid proof or outage, but retain the conflict path for a valid logical conflict.
  • Keep server user-data cache keys scoped by server instance and namespace. Keep local restore receipts out of server payloads and preserve them when normal user edits update the same browser blob.
  • Keep autoplay claims paired with playback-start and cancellation events, and keep up-next timing inputs and source-type classification shared across all clients.
  • Keep clipboard callers dependent on one failure contract so a fallback success does not trigger an unnecessary error message.
  • Treat host-health error wording and runtime-unavailable results as renderer-facing contracts.
  • Keep redaction coverage in step with new credential fields, URL forms, or trace payloads before adding them to logs.

Important failure modes

TriggerConsequenceGuard
A runtime capability is inferred from one bridge methodA service starts an action that fails when a later required method is missingCheck the complete capability group before selecting the native path.
A partial playback bridge is used for atomic backup restoreRestore can replace data without the transaction contract that makes it safeRun the restore-only preflight separately from ordinary playback capability checks.
A hosted pairing reply is accepted without checking the API instance or token shapeA browser can bind source state to the wrong host or retain an invalid credentialVerify the same-origin /api instance, reject redirects, validate the token, and use a bounded bridge request.
A hosted server status or command adds a new mode without updating the shared interfaceA runtime can show the wrong state or send a command that another runtime cannot interpretExtend the shared hosted-server command, status, and worker contracts together.
A default-on setting treats malformed input as an opt-outOlder or damaged settings silently disable a featureResolve the flag as enabled unless the stored value is exactly boolean false.
A partial nested settings record replaces the default groupA new dashboard or player choice disappears after load or saveNormalize the complete group before exposing or persisting settings.
A settings save writes a stale full record from one tabA newer TMDB key or unrelated preference is overwrittenRead the current record in the same IndexedDB transaction and preserve the key when the update did not replace it.
A TMDB transfer commits after its expected key or session is staleA key can move into the wrong settings recordCompare the stored key and current transfer state before writing.
An embedded MPV choice is marked unsupported by an inconclusive probeA valid saved player is replaced too earlyKeep inconclusive results pending and follow later support answers.
A late embedded MPV result follows a player the user already changedThe app silently changes the user's new playerRecheck that the saved choice is still embedded MPV before fallback or preparation.
A favorite operation is delivered after consent or source incarnation changesOld favorite intent can be applied to a new profile or source generationFreeze consent and source identity at enqueue time and check both before delivery.
A cached favorite context survives source replacement or source-id reuseAn offline action can target the replacement source without fresh verificationRetire the old context and require a verified new source incarnation.
Two windows commit the same favorite recordOne membership change can replace the other or leave pending intent inconsistentUse IndexedDB transactions or Electron compare-and-commit retries.
A favorite conflict is hidden by a newer explicit actionThe user choice can silently authorize an old parked server intentKeep the conflict visible and require an explicit local-or-shared resolution.
A shared favorite action also writes the legacy playlist fieldThe projection and server intent can diverge or the operation can be applied twiceRoute explicit mutations through the favorite bridge and let one owner persist them.
A shared activity operation is delivered after consent or source incarnation changesOld activity can be applied to a new profile or source generationFreeze consent and source identity at enqueue time and check both before delivery.
An explicit activity action completes after a newer launch or resetA late player callback can reclaim ownership or restore obsolete local fallbackFence actions by content identity and source scope, and discard superseded sessions before delivery.
Two windows claim the same activity outbox head from an old snapshotCheckpoints or begins can arrive out of orderClaim the head against the current store and use a short delivery lease with renewal.
A fresh activity checkpoint conflicts after another device owns the sessionA stale session can create a sibling conflict or keep sending old checkpointsRetire the conflicting session and discard its queued checkpoints.
A fresh activity begin conflicts with a newer server stateA launch can overwrite a newer owner or remain stuck offlineRebase the begin and queued operations against the returned state within the bounded retry limit.
An activity checkpoint uses an old session generation or sequenceA stale player can overwrite the current owner's resume stateReject session and sequence conflicts and require explicit resolution or a fresh launch.
A native playback row has null optional fields and is treated as a complete valueImport or later playback can send invalid metadata or lose an unknown durationNormalize nullable native fields and omit unknown protocol values.
A Stalker zero-duration episode reset becomes a resume pointA cleared episode appears playable or watched state is rebuilt incorrectlyMap exact zero position and duration to a reset without resume data.
A portal history item matches only a reused numeric idA live item, movie, or series can replace the wrong recently viewed rowMatch portal kind and series mode, while keeping legacy untyped rows compatible.
A playlist mutation overlaps refresh, portal session update, or deletionA stale full-row write can erase newer source state or resurrect a deleted playlistSerialize all per-playlist mutations and place deletion in the same queue.
A whole-library reset overlaps a queued playlist writeA late write can recreate data after the resetWait for active writes and hold the reset boundary before accepting new writes.
A playlist add is canceled by a later addThe first source is stored without its EPG fetch or navigationSerialize adds until each accepted write completes.
A refresh payload belongs to an older source identityOld channels or metadata replace the current sourceCompare source identity before reducer and service merge.
A state-only refresh action is treated as a new persistence requestA superseded payload can be written again or the accepted document is not shownMark awaited updates as non-persisting and publish the persisted result through shared hydration.
A PWA restore receipt is lost after a required list writeA retry can overwrite a user edit or replay a completed listCommit each list and its receipt in one storage blob and retain the receipt across edits.
A server-backed restore compacts receipts before server acknowledgmentA failed server write is treated as complete and cannot be retried safelyKeep the target list until the server confirms the playlist, then compact all confirmed receipts.
Browser storage is full while optional archive snapshots are written firstRequired favorites, history, or positions cannot be restoredWrite required lists first and keep only identity-confirmed required snapshot fields when quota is low.
A restore receipt is damaged or archive identity does not matchOld metadata can be replayed into a new favorite or a restore can target the wrong listFail closed on unreadable receipts and require typed identity confirmation for snapshots.
A native playback reset is stamped before the replacement position list is durableAndroid can discard a valid checkpoint even though restore failedStamp the reset in the same map write and leave the marker unchanged on failure.
A server cache is shared across server instances or namespacesA tab can compare or send user data from the wrong serverInclude instance identity and namespace in cache keys and use that cache as the diff baseline.
Restore receipts are sent as server playlist entriesServer state contains client-only progress metadata or later restores replay itStrip receipt metadata from server payloads and retain it only in the browser cache.
A database operation receives another operation's eventProgress or cancellation state appears on the wrong importMatch both operation id and operation name.
An explicit visibility write lacks native acknowledgmentA restore can treat a temporary view as durable user intentRequire the acknowledgment for explicit visibility changes.
Dormant Xtream history is cleared before native deletion succeedsExport or retry loses retained historyChange the deferred record only after the native action succeeds.
A backup read fails and becomes an empty collectionRestore clears valid favorites, history, positions, pins, or locksUse failure-propagating reads and omit data only when it is truly unavailable.
A backup is written before all destructive fields are validatedA bad entry partially changes local stateValidate the manifest and each entry before the first storage write.
A later backup entry reuses an id after an earlier restore failedThe later source can replace or merge into the wrong restored rowReserve accepted or remapped ids for the whole import.
Backup EPG matching compares raw text onlyEquivalent remote guides are duplicated, or local path spelling changesNormalize valid remote URLs for identity and preserve local references as entered.
A source pin restore clears the collection before the replacement write is safeA failed restore loses the previous preferred VOD sourcesUse one replacement operation and report a false result as a restore failure.
A catalog refresh deletes the cache before fetching replacement dataA provider outage removes the last usable catalogFetch and verify replacement data before deletion.
An autoplay claim is not canceled after a failed startThe streak reaches its limit even though no episode playedCancel the pending claim when playback does not start.
A viewer-started episode is treated as autoplayThe next autoplay prompt appears too soonMark the claim before autoplay and reset the streak for an unclaimed start.
Up-next timing accepts an invalid duration or credits pointThe card appears for a live stream or at an invalid timeRequire a finite positive duration and use the bounded fallback lead.
A source filter uses a different provider rule from its iconA source appears under one provider while showing another provider's labelReuse the shared source kind and icon precedence.

Key files

FileWhy to read it
libs/…/actions.tsDefines the shared event vocabulary for playlists, channels, EPG, and favorites.
libs/…/effects.tsShows how state events trigger persistence, EPG work, navigation, and playback.
libs/…/playlist.reducers.tsShows how refresh, authoritative loading, and shared-source hydration preserve local state.
libs/…/activity-sync.contract.tsDefines shared activity identity, sessions, revisions, and pending operations.
libs/…/activity-sync-client.tsCoordinates durable local activity, consent, source context, recovery, delivery, and projection.
libs/…/favorites-sync.contract.tsDefines favorite identity, source scope, revisions, conflicts, and pending operations.
libs/…/favorites-sync-client.tsCoordinates local favorite state, consent, source context, delivery, and conflict choice.
libs/…/playlists.service.tsDefines playlist lifecycle, storage choice, migration, write ordering, refresh, and cleanup.
libs/…/source-api.tsDefines the self-hosted source, favorite, and activity request boundary.
libs/…/source-connection.tsDefines source selection, instance identity, discovery, verification, and native pairing recovery.
libs/…/hosted-pairing-bridge.tsShows the bounded host handshake used to recover or forget a hosted browser pairing.
libs/…/source-sync.service.tsCoordinates source inventory, projection, cleanup, and connection state.
libs/…/synced-playlist-store.tsDefines revision-aware source projection, edits, conflicts, canonical ids, and local activity retention.
libs/…/data.service.tsDefines the runtime-neutral bridge and source snapshot boundary used by shared services.
libs/…/database-electron.service.tsShows renderer-facing database operations, operation events, and recovery reads.
libs/…/schema.tsDefines the shared product data model and durable relationships.
libs/…/electron-api.interface.tsDefines the native bridge contract between renderer and desktop process.
libs/…/hosted-server.interface.tsDefines hosted-server modes, status, device commands, and worker messages.
libs/…/settings-store.service.tsDefines normalized settings persistence, storage failure reporting, and committed EPG updates.
libs/…/runtime-capabilities.service.tsDefines complete runtime capability groups and safe feature selection.
libs/…/playlist-backup.service.tsDefines versioned archive validation, source matching, and cross-runtime restore.
libs/…/playlist-backup-epg.tsDefines backup EPG source identity and merge behavior.
libs/…/pwa-xtream-backup-storage.tsDefines browser Xtream list restore, typed identity, quota handling, and native reset integration.
libs/…/pwa-xtream-restore-progress.tsDefines per-list restore receipts and server confirmation rules.
libs/…/user-data-storage.tsDefines the replaceable browser and server-backed user-data storage contract.
libs/…/server-user-data-storage.tsCoordinates versioned browser-to-server user-data synchronization.
libs/…/autoplay-streak.util.tsDefines the shared autoplay run and viewer reset rule.
libs/…/up-next-timing.util.tsDefines the shared credits and duration rules for the up-next card.
libs/…/redact-sensitive-data.tsDefines the shared secret-redaction boundary for diagnostics.
libs/…/host-connectivity-guard.tsDefines fast-fail and retry behavior for unavailable portal hosts.
libs/…/clipboard-copy.util.tsDefines the runtime-neutral clipboard fallback contract.