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 / playlist-management

Playlist management

Playlist management is the user-facing path that turns a channel source into content that IPTVnator can save, check, refresh, and open. A user selects an import method, supplies source details, and receives a saved source whose content and personal settings remain available across later sessions. M3U import and parsing are covered in M3U playlist import and state. Self-hosted storage and synchronization are covered in self-hosted source synchronization. Provider-specific access is covered in provider portals, and shared server access is covered in hosted server and device access.

Source intake

The add-playlist flow gives different source types one entry point. Each source method collects its own details, but each produces a saved playlist that IPTVnator can classify and open.

Source methods

The flow supports these source methods:

  • URL — retrieve M3U content from an HTTP or HTTPS address.
  • File — select a local .m3u or .m3u8 file.
  • Xtream — connect to a provider with a server address and account details.
  • Stalker — connect to a portal with device identity details.
  • Text — provide M3U content directly.
  • Auto-detect — turn pasted provider text into a suggested import form.

Auto-detect only selects and fills a normal form. It does not add a source without the user's review and submission. The dialog keeps unfinished values when the user changes methods, so trying another method does not discard work. The method chooser is disabled while a URL source is loading, which prevents the user from changing the import while that request is active.

References: libs/…/add-playlist-dialog.component.html• L1-97 libs/…/add-playlist-dialog.component.ts• L54-73 libs/…/import-drafts.ts• L13-121 libs/…/auto-import.component.ts• L139-205

Source details

The user supplies the location, account, device identity, or content that IPTVnator needs to read a source. An optional title gives the saved playlist a stable name. When the title is blank, IPTVnator uses a source-based fallback such as a file name or content label.

The forms normalize connection details before they become saved source data. Passwords remain masked in the interface. Source locations and request settings remain available so a later refresh can repeat the request. For M3U methods, the add flow can also request guide data during import. That choice is available only while the source is not loading.

References: libs/…/add-playlist-dialog.component.html• L98-115 libs/…/add-playlist-dialog.component.ts• L116-147 libs/…/url-upload.component.ts• L49-74 libs/…/xtream-code-import.component.ts• L91-111 libs/…/stalker-portal-import.component.ts• L238-340

Source validation

Validation keeps incomplete or stale source details out of the normal import path. Local checks run first. Remote checks then confirm the parts that need a network request.

Local validation

The dialog enables submission only when the selected form has the required values. File intake checks the file type before reading it. URL intake requires an HTTP or HTTPS address. Text intake requires M3U content. Provider forms require the connection and identity fields that their source type needs.

These checks do not prove that a remote source is reachable or that its content is valid. A detected import and a URL-based provider suggestion still use the target form's checks. A connection test result also becomes invalid when the user changes the tested values.

References: libs/…/add-playlist-dialog.component.html• L126-223 libs/…/add-playlist-dialog.component.ts• L403-449 libs/…/file-upload.component.ts• L78-111 libs/…/xtream-code-import.component.ts• L118-149 libs/…/stalker-portal-import.component.ts• L87-110

Remote validation

Remote validation checks a source at the point where it can affect the saved playlist. M3U URLs are fetched before their content enters playlist state. Xtream connections can test the normalized server and account details. Stalker sources resolve the portal and device identity before authentication.

When a request fails, the dialog stays open and gives the user an error and a retry path. A panel-style Stalker source can use the documented offline fallback: IPTVnator can save its normalized connection without proving access, while warning that a later request may fail. A full Stalker portal must pass discovery and authentication.

References: libs/…/url-playlist-import.ts• L18-108 libs/…/xtream-code-import.component.ts• L118-135 libs/…/stalker-portal-import.component.ts• L374-587

Validation results

A successful check moves the source to playlist creation. A failed fetch, rejected account, invalid file, empty file, stale test, or parser error leaves the source out of the saved playlist list. The only exception is the documented offline fallback for a panel-style Stalker source.

References: libs/…/add-playlist-dialog.component.ts• L240-255 libs/…/url-playlist-import.ts• L35-89 libs/…/stalker-portal-import.component.ts• L486-531

Playlist creation

After validation, IPTVnator creates a playlist record and saves it for normal use. M3U sources become channel data. Provider sources keep the connection data that their provider workspace uses to load content.

M3U content preparation

M3U import parses source text into a header and channel items, then gives the result an application identity. The saved playlist keeps its title, item count, import time, source location when one exists, and guide URLs found in the source. For URL imports, the selected guide option is applied after fetch and before save.

For the detailed M3U flow, see M3U playlist import and state.

References: libs/…/playlists.service.ts• L1202-1227 libs/…/playlist.utils.ts• L369-417 libs/…/parsed-playlist.interface.ts• L3-38

Durable playlist record

The saved playlist is the boundary between source intake and normal application use. It retains source identity and user-owned state such as favorites, recent items, order, hidden groups, and guide choices.

The playlist service uses one record contract across its storage authorities. A browser uses IndexedDB. A desktop runtime uses local database storage. A self-hosted setup uses the server store. IPTVnator reads playlist metadata at startup so the user can select a source without importing it again.

The service orders changes for each playlist. Refresh, edit, favorite, history, position, session, and delete actions cannot replace newer state with an older full record. A store-wide removal waits for pending row changes and blocks new changes until reset completes. If a self-hosted server reports that another device changed a record, the service retries from a fresh copy instead of overwriting the newer state.

Self-hosted storage adds a second lifecycle for source data. Synchronization keeps the selected local playlist and its configured self-hosted copy aligned. See self-hosted source synchronization for that storage path.

References: libs/…/playlists.service.ts• L390-483 libs/…/playlists.service.ts• L534-587 libs/…/playlists.service.ts• L618-737 libs/…/playlists.service.ts• L1290-1342 libs/…/playlist-storage-backend.ts• L13-128 libs/…/playlist-cross-context-lock.ts• L20-69

Playlist details

The playlist details view lets the user change saved metadata and source settings after import. Provider passwords stay masked until the user reveals them. Provider edits must keep the saved connection complete and valid before they replace the current record.

The details view loads the complete saved connection before editing source types that need it. A changed M3U source is saved and then fetched again. If that load fails, the new source remains saved while the previous channels remain available, the dialog stays open, and the user can retry. A source refresh already in progress blocks that source change, but it does not block unrelated metadata edits. Provider connection fields use their own connection flow instead of the M3U source-change flow.

For a full Stalker portal, a changed connection is resolved against the portal before it replaces the saved connection. The view warns when stored device identity has already been accepted by that portal. A simple panel source does not show that warning because it does not use the same identity exchange.

The same view manages guide sources. Users can enable detected sources, add URL or local-file references, disable sources, clear data for a removed source, and request a new guide fetch when supported. They can also export stored M3U content or copy its source URL.

References: libs/…/playlist-info.component.html• L74-359 libs/…/playlist-info.component.html• L360-731 libs/…/playlist-info-saver.ts• L87-332 libs/…/playlist-info.component.ts• L222-341 libs/…/playlist-info-form.ts• L53-127 libs/…/playlist-source-change.ts• L1-17 libs/…/stalker-playlist-edit.utils.ts• L26-98

Content access

After persistence, IPTVnator can fetch guide data when needed and make the new playlist active. The workspace then presents content through the view for that source type. M3U sources provide live, radio, catch-up, and eligible VOD views. Provider sources use their provider workspace.

Playlist selection

The source list and switcher let the user search, filter by source type or health status, reorder, open, refresh, and remove saved sources. Custom ordering applies to the full library even when filters hide some sources, so hidden sources keep their positions. The quick switcher also groups recent sources and links to the full source list or the add flow. Saved source fields determine the source type and the workspace that opens for it. The active playlist identity scopes its content and guide state.

The switcher supports keyboard search and selection while keeping the current source visible. It hides sources that are pending deletion, while a deletion in progress remains visible so the user can see its progress and stop it. It prevents selection, removal, and drag ordering while a source is busy. During refresh, source rows can show the current stage, progress, and a cancel action. A failed source can expose a recheck action instead of a normal refresh action.

This diagram shows how the source list turns saved records into filtered, ordered actions and then into an active workspace.

flowchart LR
    R[Saved sources] --> F[Search and status filters]
    F --> O[Sort or custom order]
    O --> A[Open, refresh, edit, or remove]
    A --> W[Source-specific workspace]

References: libs/…/playlist-switcher-panel.component.html• L8-170 libs/…/playlist-switcher-panel.component.ts• L127-184 libs/…/playlist-switcher-panel.component.ts• L248-357 libs/…/recent-playlists.component.ts• L121-197 libs/…/recent-playlists.component.ts• L230-306 libs/…/playlist-switcher.component.ts• L130-186 libs/…/source-row.component.html• L1-180 libs/…/source-list-refresh.service.ts• L49-165 libs/…/playlist-context.facade.ts• L77-112 libs/…/m3u-workspace.routes.ts• L6-38

M3U playback workspace

The M3U workspace turns the active playlist into a channel browsing and playback area. It supports live video, radio, catch-up playback, and eligible VOD content, with the electronic programme guide available alongside compatible live playback.

The channel list remains available while the player is fullscreen through a local panel. That panel can show all channels, groups, favorites, or recent channels without changing the page route. It limits choices to rows that can keep the current fullscreen playback surface active. On small screens, the channel list becomes a bottom drawer so the player and channel browsing remain usable together.

References: libs/…/video-player.component.ts• L287-321 libs/…/video-player.component.ts• L331-355 libs/…/video-player.component.html• L80-255 libs/…/video-player.component.html• L275-289 libs/…/m3u-fullscreen-channel-list.component.ts• L20-86 libs/…/video-player.component.scss• L113-148

Source health

Supported saved sources can show a source-health result. The check gives the user a current view of access without changing the saved playlist. Recent results can be reused. A fresh check can be requested when the source may have changed.

The cleanup flow groups sources by health certainty and deletion result. Confirmed inactive sources become cleanup candidates. Sources that are still checking, uncertain, protected, skipped, or unresolved remain visible in their own groups. Selected candidates can be deleted as a batch with progress. While deletion runs, the dialog is locked except for its stop action, and each source ends as deleted or failed.

References: libs/…/source-health-indicator.component.ts• L20-111 libs/…/source-health.service.ts• L62-125 libs/…/source-cleanup-dialog.component.ts• L45-195 libs/…/source-cleanup-dialog.component.ts• L243-318

Refresh and removal

A saved source can refresh when IPTVnator still has a usable URL. A local file can refresh when the runtime supports file refresh. M3U sources are fetched and parsed again. Supported Xtream sources use a catalog rebuild path when the runtime provides its provider data store. A refresh replaces source-owned content while keeping user-owned state such as favorites, order, recent items, and guide choices.

M3U refresh saves the new content before publishing it to the active application state. If the save fails, the old visible content remains in place. A source edit reports success only after its new content loads; a failed load keeps the new source setting and old channels so the user can retry.

Xtream refresh asks for confirmation before rebuilding the provider catalog. It parks user-owned state, removes the cached catalog, and opens the provider workspace so the catalog can load again. The shared flow prevents two entry points from rebuilding the same source at the same time. It also reports preparation and catalog progress while the source is busy.

Refresh reports its work as a source-wide busy operation. M3U refreshes report fetch, file-read, parse, and save stages. Xtream refreshes can report their provider re-import stages. The action is guarded so a second refresh or conflicting edit does not start while the source is busy. A failing source can be rechecked. If a URL uses an invalid TLS certificate, the user can explicitly trust that host and retry.

The refresh path merges new content with the current saved row before it writes. This prevents an older refresh snapshot from undoing a newer edit or synchronization update. Removal deletes the saved source and clears its active selection. The list hides a source after removal is pending, except while its deletion progress must remain visible. If the active source is removed, the selection hands over to an eligible neighboring source. The list and shared state then stop presenting the removed source.

References: libs/…/playlist-refresh-action.service.ts• L72-165 libs/…/playlist-refresh-action.service.ts• L168-291 libs/…/playlist-refresh-action.service.ts• L307-375 libs/…/xtream-refresh-flow.service.ts• L128-327 libs/…/source-list-refresh.service.ts• L80-165 libs/…/source-list-refresh.service.ts• L179-226 libs/…/playlist-refresh-merge.ts• L13-72 libs/…/playlists.service.ts• L699-737 libs/…/recent-playlists.component.ts• L230-306

Change checklist

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

  • Keep the source fields used for provider classification aligned with routing, icons, filtering, and workspace selection.
  • Keep auto-detect candidate kinds aligned with the target import forms. Detection must preserve source values and remain subject to normal validation.
  • Keep source locations and request settings aligned across import, persistence, refresh, and source editing. A source that loses either value may still open but cannot repeat its request.
  • Keep the parsed playlist shape aligned with the saved item shape. Channel views and guide-source detection depend on both the parsed header and item data.
  • Keep M3U source-edit outcomes aligned with refresh outcomes. A failed load must retain the new source and old channels, while a skipped load must remain distinct from success.
  • Keep M3U source-edit rules aligned with refresh guards. A changed URL or file path must trigger one new fetch and must not race with an active refresh.
  • Keep provider connection edits separate from M3U source edits. Xtream and Stalker changes need their own normalization and connection handling.
  • Keep complete Stalker connection data and shared source revisions hydrated before edits. A summary row must not overwrite identity or synchronization state that was not loaded into the form.
  • Keep selected storage authority aligned across startup, import, refresh, synchronization, and deletion. An unavailable self-hosted store must not silently switch to another authority.
  • Keep all playlist mutations inside the per-playlist ordering and cross-context locking rules. A late refresh or edit must not recreate or overwrite a newer row.
  • Keep server revision checks aligned with mutation retries. A conflict must rerun the full mutation from a fresh row, and an exhausted retry must fail rather than overwrite another device's change.
  • Keep refresh merge rules aligned with ownership. Source content may change, but favorites, order, recent items, guide choices, and source-sync state must remain consistent.
  • Keep Xtream refresh guards shared across entry points. User state must be parked once before catalog deletion and restored on the next import.
  • Keep store-wide reset locking aligned with row writes. Remove-all must wait for queued work and prevent new work until deletion completes.
  • Keep source filters and custom ordering aligned with the full source library. A hidden source must retain its unique position, and status checks must not stop because a row is filtered out.
  • Keep cleanup grouping aligned with health certainty, protection, and result states. An uncertain source must not become a silent delete candidate, and a running batch must keep its stop and result states clear.
  • Keep guide-source removal aligned with data cleanup. Do not remove a source from the playlist record when its stored guide data was not cleared.
  • Keep the active playlist identity aligned with guide scope and provider routing. A playlist switch must not leave content or guide state attached to the old source.
  • Keep source-row action guards aligned with activity state. Refresh, edit, remove, retry, drag, and cancel actions must not expose conflicting operations for a busy source.
  • Keep fullscreen channel filtering aligned with the playback modes that can keep the fullscreen player mounted. Local fullscreen views must not navigate the underlying workspace.
  • Keep the compact M3U player layout aligned with the channel list and guide behavior on narrow screens. A mobile list must not hide the player or leave the hidden sidebar interactive.

Important failure modes

TriggerConsequenceGuard
File is unsupported, empty, unreadable, or not valid M3UNo playlist record is created.File intake and parsing reject the source before the add action.
M3U URL fetch fails during import or refreshThe source is not added or refreshed.The flow reports a bounded fetch error and keeps the existing record during refresh.
A new M3U source is saved but its first load failsThe new source is saved while old channels remain available.The details view stays open, marks the load as failed, and lets the user retry.
URL import is cancelled or the dialog closes during fetchA late response could add an abandoned source.The dialog ignores responses that no longer belong to the active import.
Xtream values change during a connection testA stale result could authorize the wrong account.The test result is tied to the current form values.
Stalker authentication rejects the portal identityNo validated playlist is saved and the refusal remains visible.Discovery and authentication return a typed result for correction or retry.
Stalker panel is unreachableA saved source can fail later when content is requested.The offline fallback is limited to panel-style sources and warns the user.
A full Stalker portal has already pinned a device identity and the user changes itThe portal can reject the connection or lock the source out.The details view warns for stored full-portal identities and resolves the changed connection before saving.
M3U source changes while its refresh is runningThe new source could be saved without being fetched, leaving old content active.Source changes are refused while the source is busy.
A saved source has no usable URL or file pathRefresh cannot reproduce the source request.Refresh is offered only when the source type and runtime support a usable source location.
A URL has an invalid TLS certificateRefresh stops before retrieving source content.The user must explicitly trust the normalized host before retry.
Xtream refresh is interrupted after catalog removalProvider content can remain unavailable until the refresh is retried.User state is parked before deletion and the shared flow clears its busy state for recovery.
Two Xtream refresh entry points update one playlist at the same timeOne run could park over the other run's favorites, history, or positions.A shared refresh registry blocks duplicate destructive runs.
Self-hosted storage is not ready or is offlineA read or write cannot complete through the selected authority.The storage boundary reports the unavailable state instead of silently changing authority.
Two actions update one playlist at the same timeAn older full-row snapshot could replace a newer change.Playlist mutations are ordered per playlist and refreshes merge with the current row.
Another device changes a playlist during a self-hosted writeThe write is stale and must not replace the newer server row.The mutation retries from a fresh read a bounded number of times, then fails.
Remove-all starts while playlist writes are pendingA late write could recreate a deleted playlist.The reset waits for queued work and blocks new writes until the delete completes.
A source is hidden by a status filter during checkingThe source could stop receiving checks because it is not visible.Health checks use the full source list rather than only visible rows.
Source removal is pending or the source is busyA second action could race with deletion or refresh.Pending sources are hidden, busy rows disable conflicting actions, and active removal chooses a replacement source.
Source health is uncertain or protected during cleanupThe source is skipped instead of being safely deleted.Cleanup requires confirmed eligibility and reports each result.
Guide data cannot be cleared for a removed playlist sourceThe source remains enabled and its metadata is not changed.Cleanup reports the error and updates the source only after data removal succeeds.
User switches playlists while an M3U guide is openThe guide could show channels from the old playlist.The workspace closes or re-scopes the guide when the active playlist changes.
User selects a radio or VOD row from the fullscreen channel panelThe current fullscreen player could be replaced and fullscreen could close.The panel offers only rows that keep the inline playback surface active.

Key files

FileWhy to read it
libs/…/add-playlist-dialog.component.tsShows how source methods converge on the import path and preserve method drafts.
libs/…/add-playlist-dialog.component.htmlShows the source chooser, forms, guide-import choice, and shared validation actions.
libs/…/url-playlist-import.tsShows URL acquisition, retry, cancellation, and guide-option handling.
libs/…/auto-import.component.tsShows how pasted provider text becomes reviewable candidates without bypassing validation.
libs/…/xtream-code-import.component.tsShows the Xtream connection and test boundary.
libs/…/stalker-portal-import.component.tsShows Stalker identity settling, discovery, authentication, and offline panel fallback.
libs/…/playlists.service.tsShows parsing, storage selection, ordered mutation, playlist loading, refresh merge, and deletion.
libs/…/playlist-storage-backend.tsDefines the common playlist document boundary for browser, desktop, and self-hosted storage.
libs/…/playlist-cross-context-lock.tsShows how row changes and store-wide resets coordinate across browser contexts.
libs/…/playlist-refresh-merge.tsShows how refreshed source content is combined with current user state and source-sync data.
libs/…/playlist-switcher-panel.component.tsShows how source search, type filtering, recent grouping, keyboard selection, busy guards, and source actions work in the quick switcher.
libs/…/playlist-switcher-panel.component.htmlShows the quick switcher actions, source filters, accessible list, and source-row actions.
libs/…/recent-playlists.component.tsShows full-library filtering, custom ordering, source selection, busy guards, refresh status, and removal handoff.
libs/…/source-row.component.htmlShows source-row actions for opening, editing, refreshing, retrying, cancelling, and removing sources.
libs/…/playlist-info-dialog.tsKeeps the details dialog size and data contract consistent across entry points.
libs/…/playlist-info.component.tsShows post-import source edits, authoritative connection loading, guide-source management, and export actions.
libs/…/playlist-info.component.htmlShows editable source details, guide-source actions, load-failure feedback, and save behavior.
libs/…/playlist-info-form.tsShows which saved source details are editable and which values are validated.
libs/…/playlist-info-saver.tsShows how metadata saves, source changes, provider connection changes, and load outcomes are sequenced.
libs/…/playlist-refresh-action.service.tsShows source-specific refresh paths, busy guards, save-before-publish behavior, progress, and TLS retry handling.
libs/…/xtream-refresh-flow.service.tsShows the shared confirmed Xtream catalog rebuild and user-state preservation flow.
libs/…/source-list-refresh.service.tsShows source-list refresh progress, cancellation, and shared activity state.
libs/…/source-cleanup-dialog.component.tsShows how health certainty becomes grouped cleanup candidates and locked deletion results.
libs/…/recent-playlists.component.tsShows selection, filtering, custom ordering, refresh progress, cancellation, and removal after import.
libs/…/playlist-context.facade.tsShows how the active playlist maps to a provider workspace and content section.
libs/…/video-player.component.tsShows how the active M3U source supplies channel browsing, playback, guide state, recent history, and fullscreen channel choices.
libs/…/video-player.component.htmlShows the user-facing relationship between the channel list, player, guide, and fullscreen panel.
libs/…/m3u-fullscreen-channel-list.component.tsShows the local fullscreen views for all channels, groups, favorites, and recent channels.
libs/…/video-player.component.scssShows the responsive relationship between the M3U player, channel list, and guide area.