Dispatcharr/apps
Jacob Lasky 808fadfef2 fix(m3u): abort XC refresh on empty provider fetch to prevent channel wipe
When an Xtream Codes provider returns no live streams on a routine refresh
(a transient upstream failure, a fetch exception, or no enabled category
matching), collect_xc_streams() returns an empty list. The refresh then fell
through to stale-marking and sync_auto_channels, which -- with nothing seen
this refresh -- deletes the account's entire auto-created channel lineup via
its per-group "no streams remaining" branch.

Guard the XC branch of _refresh_single_m3u_account_impl: on an empty result,
set the account to ERROR and return before stale-marking and auto-sync,
mirroring the standard-path empty/failed-download guards already in the
function. A transient empty fetch can no longer destroy channels.

Adds apps/m3u/tests/test_xc_empty_fetch_guard.py covering both the abort
(sync not called, channels preserved, streams not marked stale, status ERROR)
and the healthy path (non-empty fetch still runs sync).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 12:02:01 -04:00
..
accounts feat(auth): add QueryParamJWTAuthentication for token retrieval via query parameters 2026-05-30 11:14:59 -05:00
api initial connect feature 2026-02-08 09:29:22 -05:00
backups refactor(backups): simplify PostgreSQL engine check in _is_postgresql function 2026-05-30 20:18:50 -05:00
channels refactor(channels): optimize stream retrieval in ChannelSerializer and add tests for query efficiency 2026-06-18 15:24:23 -05:00
connect refactor(trigger_event): streamline event dispatching and improve plugin action handling 2026-06-16 11:25:17 -05:00
dashboard modified database fields for consistency, removed custom_url from streams (no longer needed) 2025-03-16 09:07:10 -04:00
epg fix(epg): enhance DB connection management and error handling during EPG refreshes 2026-06-18 16:39:52 -05:00
hdhr fix(api): update HDHR URLs to use port-aware URI builder 2026-06-07 14:27:57 -05:00
m3u fix(m3u): abort XC refresh on empty provider fetch to prevent channel wipe 2026-06-22 12:02:01 -04:00
output enhancement(epg): improve custom dummy EPG generation performance 2026-06-18 17:12:43 -05:00
plugins refactor(trigger_event): streamline event dispatching and improve plugin action handling 2026-06-16 11:25:17 -05:00
proxy fix(proxy): update for improved DB connection management 2026-06-17 17:22:28 -05:00
vod fix(xc): normalize server URLs for live playback and stream URLs (Fixes #1363) 2026-06-18 10:12:12 -05:00