Dispatcharr/apps
R3XCHRIS ff60bbec1a fix(vod_proxy): fall back to stream_id when content UUID is dead
Issue: When `process_movie_batch` / `process_series_batch`
(apps/vod/tasks.py) creates duplicate vod_movie / vod_episode records
during a refresh, existing M3U*Relation rows get repointed to the new
records. The old UUIDs that external players (Emby / Jellyfin /
ChannelsDVR) cached in `.strm` URLs are left orphaned, and the proxy
404s on every subsequent request — even though the same request
already carries a stable `stream_id` that uniquely identifies a live
relation.

This patch makes `_get_content_and_relation` use a soft UUID lookup
and, if it misses, fall back to resolving content via
`M3UMovieRelation.stream_id` / `M3UEpisodeRelation.stream_id`. The
fallback respects the strictest match first: when
`preferred_m3u_account_id` is also present, that account is queried
first; otherwise the highest-priority active relation matching the
stream_id wins (same ordering the existing relation-selection logic
uses).

This is read-side graceful degradation, complementary to the
write-side root fix proposed in closed #973 (re-use the relation's
existing movie/series during refresh rather than rematching by TMDB
ID). The two PRs together would fully resolve #961: #973 prevents new
orphaning, this PR makes any URL that ships a stream_id survive past
orphaning. URLs without a stream_id (e.g. XC-compat
`/movie/<user>/<pass>/<id>.mkv`) are NOT covered by this patch — they
need the root fix.

Series-UUID lookups (`/proxy/vod/series/<UUID>`) are left UUID-only by
design — players cache episode and movie URLs, not series URLs. Same
pattern can be added as a follow-up if needed.

Tests: 7 new mock-based regression tests covering both branches,
verified against `:dev`. UUID-first happy path is unchanged
(M3U*Relation table never queried when the UUID resolves).

Related: #961 (open), closed #973 (root fix abandoned for inactivity).
2026-06-02 19:29:58 +01: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 feat(utils): move get_host_and_port and build_absolute_uri_with_port to core/utils.py 2026-05-30 17:26:58 -05:00
connect fix: replace fork()-based subprocess with posix_spawn at all uWSGI spawn sites 2026-05-15 16:45:09 -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 refactor(epg): change logger level from info to debug for building byte-offset index 2026-06-01 18:58:00 -05:00
hdhr feat: Add HDHR output profile support and reorganize settings 2026-05-10 11:14:02 -05:00
m3u fix: update profile save method to include expiration date in custom properties 2026-05-17 17:43:15 -05:00
output security: Remove post body from response. 2026-05-31 16:20:55 -05:00
plugins Enhancement: add caching for plugin detail responses and implement cache invalidation on repo refresh. 2026-05-21 16:12:31 -05:00
proxy fix(vod_proxy): fall back to stream_id when content UUID is dead 2026-06-02 19:29:58 +01:00
vod Merge pull request #1287 from nemesbak/fix/vod-metadata-director-cast-releasedate 2026-05-29 21:32:39 -05:00