fix(xtream): retain saved snapshots through browser restore retries

This commit is contained in:
4gray committed 2026-10-14 04:14:14 +02:00
1 parent ef90961a3a
commit 29b0333fde
15 files changed
+704 -414

No files matched your search

@@ -250,6 +250,18 @@ context panel use, out of that barrel for the same reason, and
22 KB, used only by the lazy settings page) out of the `@iptvnator/services`
barrel.
`@iptvnator/services/pwa-xtream-backup-storage` exposes the framework-free browser
backup persistence implementation without re-exporting it from the eager services
barrel. The injected backup service wraps it; deferred restore loads it through a
local dynamic-import module with the data source's storage. Its map keys live in
a separate pure module so it does not import the Angular storage token at runtime.
Electron favorites likewise load their
legacy pending-conversion helper only when a favorites operation needs it.
Those lazy helpers value-import the pure normalizer through
`@iptvnator/shared/interfaces/xtream-restore-state`; their remaining contracts
use type-only imports so a deferred conversion does not load the interfaces
barrel's Angular/IndexedDB dependencies.
The web app's root shell (`app.component.ts`, `app.config.ts` and the services
they construct) is on the renderer's initial path, where a barrel costs its
whole library: esbuild keeps every Angular component module a barrel
@@ -101,6 +101,14 @@ Browser imports convert desktop favorite snapshots into typed collection-cache
rows so saved titles and artwork remain visible offline. Browser exports include
the normalized nested favorite snapshots as well as their optional collection
cache, preserving metadata when the archive returns to Electron.
Initial browser imports and deferred retries share `PwaXtreamBackupStorage`;
`PwaXtreamBackupStateService` supplies its injected storage for the importer.
Both write the lists first and require the nested favorite snapshots to persist
before consuming pending state. A quota or storage failure keeps the archive
parked for another attempt, including when the provider returns an empty catalog.
Legacy browser-only `collectionItems` remain an optional cache; their quota
failure does not invalidate a restore with no durable nested favorite snapshots.
The PWA retry loads that storage implementation on demand through a local module.
Both Xtream data-source and portal-activity capabilities require the pending
favorite conversion bridge; activity reads also require playlist lookup. The