Commit graph

1320 commits

Author SHA1 Message Date
SergeantPanda
60a9f6843b refactor: simplify initialization wait logic by removing keepalive packet handling (Fixes #1280) 2026-06-02 20:54:59 -05:00
SergeantPanda
2dc07bbe84
Merge pull request #1315 from R3XCHRIS:fix/vod-streamid-fallback-on-dead-uuid
fix(vod_proxy): fall back to stream_id when content UUID is dead (#961)
2026-06-02 20:32:11 -05:00
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
None
2a5889f5b2 fix(channels): Channel Group Override interactions
- Compact numbering: resolve the source relation when an override stores channels under the target group, so hiding releases the slot, unhiding assigns one, and repack sees the channels (no more spurious RANGE_EXHAUSTED). Type-safe override match; the bulk path stays single-query on the common path.
- Channel form: keep the clear-override control available when an override's value equals the provider value (isFormFieldOverridden is now existence-aware).
- Tests: compact override hide/unhide/repack, no-override fast-path guard, repack query-scaling guard, and existence-aware override detection.
2026-06-02 00:04:44 -05:00
SergeantPanda
8e03427844 Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into pr/FiveBoroughs/938 2026-06-01 18:58:14 -05:00
SergeantPanda
ec06a52fd4 refactor(epg): change logger level from info to debug for building byte-offset index 2026-06-01 18:58:00 -05:00
SergeantPanda
ddd1105d5b security: Remove post body from response. 2026-05-31 16:20:55 -05:00
Five Boroughs
374c05952b
test(epg): cover real EPG source formats and index lookup edge cases 2026-05-31 22:26:39 +02:00
Five Boroughs
f8919b0d98
fix(epg): handle attr-spacing and named entities in index lookup, unblock boot rebuild 2026-05-31 21:57:26 +02:00
Five Boroughs
10d558f136
perf(epg): async index build, defer index column, tight build lock, channel-id canonicalization, retry-on-error 2026-05-31 17:13:11 +02:00
Five Boroughs
2cfea1df0f
perf(epg): per-channel interleaved tracking, defer first-preview build
Also renames the migration to `0023_` to resolve collision with
upstream `0022_alter_epgdata_name`. Rationale in #938.
2026-05-31 17:13:11 +02:00
SergeantPanda
1e9fd28653
perf(epg): defer loading of programme_index in EPGSourceViewSet for performance improvement
Co-authored-by: Copilot <copilot@github.com>
2026-05-31 17:13:11 +02:00
SergeantPanda
690fa10be4
refactor(epg): remove redundant current time retrieval in CurrentProgramsAPIView 2026-05-31 17:13:11 +02:00
Five Boroughs
7c0c513f8f
test(epg,frontend): add coverage for current-program lookup and preview behavior 2026-05-31 17:13:11 +02:00
Five Boroughs
dd6c4df62b
Store programme index in DB and add interleaved XMLTV file support 2026-05-31 17:13:11 +02:00
Five Boroughs
3c5032ee71
Batch ProgramData query and invalidate index on EPG refresh
- Replace per-entry ProgramData DB query with single batch fetch
- Pass pre-loaded EPGData objects to find_current_program_for_tvg_id
  to avoid redundant select_related re-fetch
- Delete Redis programme index before XMLTV download so stale byte
  offsets are never used during the refresh window
2026-05-31 17:13:11 +02:00
Five Boroughs
8f1dd2ffeb
Revert unintended whitespace changes in apps.py and Channel.jsx 2026-05-31 17:13:11 +02:00
Five Boroughs
2bf4e8cd0f
WIP: EPG channel preview with byte-offset index lookup 2026-05-31 17:13:11 +02:00
FiveBoroughs
4594cce47a
Revert unintended linter style changes in api_views.py 2026-05-31 17:13:11 +02:00
FiveBoroughs
ef1518a8dd
Fix: Auto-parse EPG programs for unlinked channels on preview
When selecting an EPG channel in the channel form, if that EPG entry's
programs had never been parsed, the preview showed "No current program".
This was because parse_programs_for_tvg_id requires a linked channel.

- Add force parameter to parse_programs_for_tvg_id to bypass channel check
- Auto-trigger parsing from current-programs API when no programs exist
- Check Redis task lock to prevent duplicate parse tasks from concurrent requests
- Frontend retries up to 3 times with 10s delay to pick up parsed results
- Skip parsing for dummy EPG sources
2026-05-31 17:13:11 +02:00
FiveBoroughs
9367d76dac
Add EPG program preview to channel edit/create modal
- Extended CurrentProgramsAPIView to accept epg_data_ids parameter
- Added getCurrentProgramForEpg() API method in frontend
- Added UI in Channel form showing current program with tooltip
- Shows loading state, no program state, and program details
- Includes expandable description, progress bar with elapsed/remaining time
- Matches stats page 'Now Playing' feature behavior
2026-05-31 17:13:11 +02:00
SergeantPanda
450b384419 fix(vod_proxy): Fix stream_vod to handle session_id in path for VOD proxy URLs 2026-05-30 20:48:17 -05:00
SergeantPanda
50f0c37fa5 refactor(backups): simplify PostgreSQL engine check in _is_postgresql function 2026-05-30 20:18:50 -05:00
SergeantPanda
ae3c839812 feat(backups): refactor SQLite backup and restore methods for improved reliability 2026-05-30 20:15:08 -05:00
SergeantPanda
ae16e1202c feat(views): import build_absolute_uri_with_port in views.py 2026-05-30 17:58:01 -05:00
SergeantPanda
20f54b2bf6 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
SergeantPanda
72d1520400 feat(auth): add QueryParamJWTAuthentication for token retrieval via query parameters
feat(vod): include token in stream URL for episode and movie requests (Fixes #1224)
2026-05-30 11:14:59 -05:00
SergeantPanda
effa03b2a5 Enhancementvod): optimize xc_get_series for performance and reduce API response time 2026-05-30 09:08:54 -05:00
SergeantPanda
157c87ce4d feat(vod): optimize xc_get_vod_streams for performance and reduce API response time 2026-05-29 22:12:55 -05:00
SergeantPanda
efea46b08b
Merge pull request #1287 from nemesbak/fix/vod-metadata-director-cast-releasedate
fix(vod): import director, actors and release_date from XC provider during sync
2026-05-29 21:32:39 -05:00
SergeantPanda
fc867b7f77 fix(vod): enhance metadata extraction for actors and preserve existing values 2026-05-29 21:18:16 -05:00
SergeantPanda
e871010366 feat(vod): enhance xc_get_vod_streams with additional movie details and updated trailer field 2026-05-29 20:55:29 -05:00
SergeantPanda
d8ead97049 Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into pr/nemesbak/1285 2026-05-29 19:24:35 -05:00
SergeantPanda
36879c10f2 fix(vod): validate relation_id and handle loading state in VODModal 2026-05-29 19:23:13 -05:00
nemesbak
ac84916974 fix(vod): preserve advanced-refresh metadata and fix youtube_trailer key
- Use 'youtube_trailer' key (matching api_views.py and advanced refresh)
  instead of orphaned 'trailer' key that was never consumed.
- On basic sync, only write director/actors/release_date to
  custom_properties when the field is currently empty. This prevents
  basic sync from overwriting richer data previously stored by
  refresh_movie_advanced_data, while still populating those fields for
  movies that have never had an advanced refresh run.

Tested: logic verified against all three scenarios (preserve existing
rich data, populate empty fields, youtube_trailer key propagation).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 01:06:58 +02:00
SergeantPanda
e45e4fc86f
Merge pull request #1288 from nemesbak:fix/stream-profile-override-ignored
fix(channels): honor per-channel stream profile override during streaming
2026-05-29 17:08:40 -05:00
SergeantPanda
b63650799a docs: Restored todo as this did not resolve it. Cleaned up overly verbose comment. 2026-05-29 17:07:55 -05:00
nemesbak
f08a30e303 fix(vod): import director, actors and release_date from XC provider sync
get_vod_streams on XC providers supplies director, cast/actors and
release_date for each movie, but process_movie_batch was only persisting
trailer in custom_properties. As a result those fields were always empty
in Dispatcharr's own get_vod_info / provider-info responses even when
the upstream provider returned correct data.

Changes:
- Extract director, actors (also mapped from 'cast') and release_date
  from movie_data during the batch-import phase and store them in
  custom_properties alongside the existing trailer field.
- Fix the update path to merge incoming custom_properties into the
  existing dict (using {**existing, **incoming}) rather than overwriting
  it wholesale, so that detailed_info and other keys written by the
  advanced refresh task are preserved across subsequent basic syncs.

Fixes #1228

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 13:39:05 +02:00
nemesbak
5eb118478b fix(channels): honor stream profile override in Channel.get_stream_profile()
Channel.get_stream_profile() read self.stream_profile directly, bypassing
the override system. The override-aware property effective_stream_profile_obj
already existed and called _resolve_effective_fk('stream_profile') which
correctly picks override.stream_profile when set, but nothing in the
streaming path called it.

As a result, a per-channel 'Stream Profile' override saved through the UI
was visible in the channel edit form (yellow pencil indicator appeared) but
silently ignored at stream time — Dispatcharr always used the global default
profile regardless of what was configured per-channel.

Fix: call effective_stream_profile_obj in get_stream_profile() so that all
callers (live proxy url_utils, input manager, views) automatically pick up
channel-level overrides without any further changes.

Fixes #1268

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 13:39:05 +02:00
nemesbak
5fbe38f8d2 fix(vod): respect relation_id when switching providers in SeriesModal/VODModal
The provider-info endpoints for both series and movies always returned
data from the highest-priority relation, ignoring the provider the user
had selected in the dropdown. Switching sources in the UI produced no
change in the episode list or movie details.

Root cause: the endpoints had no support for a relation_id query param,
and the frontend never passed one when the user changed the selection.

Fix (backend):
- series provider-info: accept ?relation_id=<id> and query that specific
  M3USeriesRelation; fall back to highest-priority when omitted
- movie provider-info: same treatment for M3UMovieRelation

Fix (frontend):
- api.getSeriesInfo / api.getMovieProviderInfo accept an optional
  relationId argument and append it to the query string
- useVODStore.fetchSeriesInfo / fetchMovieDetailsFromProvider forward
  the argument to the API layer
- SeriesModal.onChangeSelectedProvider re-fetches series info (episodes
  included) with the newly selected relation's id
- VODModal.onChangeSelectedProvider re-fetches movie details with the
  newly selected relation's id

Fixes #1250

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 13:39:04 +02:00
SergeantPanda
61c187fc72 Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into pr/JCBird1012/1255 2026-05-23 21:43:13 -05:00
SergeantPanda
92d3068be0 fix: ensure migrations run automatically after restoring backups to prevent missing schema issues 2026-05-23 21:25:44 -05:00
SergeantPanda
812d25b987 fix: resolve SynchronousOnlyOperation in ORM calls by allowing async unsafe operations 2026-05-23 13:54:41 -05:00
SergeantPanda
137241f873 Bug Fix: Fix auto sync migration. (Fixes #1259)
Some checks are pending
CI Pipeline / prepare (push) Waiting to run
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Blocked by required conditions
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
CI Pipeline / create-manifest (push) Blocked by required conditions
Build and Push Multi-Arch Docker Image / build-and-push (push) Waiting to run
2026-05-22 13:53:00 -05:00
SergeantPanda
59587cbe66 Fix XC stream URL format output handling and improve M3U playlist generation performance. Removed unused imports in apps\output 2026-05-22 11:51:16 -05:00
SergeantPanda
7e0ea5eae0 Enhancement: add caching for plugin detail responses and implement cache invalidation on repo refresh.
Some checks failed
CI Pipeline / prepare (push) Waiting to run
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Blocked by required conditions
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
CI Pipeline / create-manifest (push) Blocked by required conditions
Build and Push Multi-Arch Docker Image / build-and-push (push) Waiting to run
Frontend Tests / test (push) Waiting to run
Base Image Build / prepare (push) Has been cancelled
Base Image Build / docker (amd64, ubuntu-24.04) (push) Has been cancelled
Base Image Build / docker (arm64, ubuntu-24.04-arm) (push) Has been cancelled
Base Image Build / create-manifest (push) Has been cancelled
Bug Fix: The plugin detail endpoint called GPG via `subprocess.Popen` to verify per-plugin manifest signatures. Replaced with a `_gpg_run()` helper that uses `os.posix_spawn`, matching the pattern used by the ffmpeg and script-handler fixes.
2026-05-21 16:12:31 -05:00
SergeantPanda
17e6e8c238 chore: Cleanup unused code. 2026-05-21 10:13:28 -05:00
Jonathan Caicedo
6787e4912f refactor: replace multiple hget calls with hmget where fields are known
- channel_status.py: fold output_format and output_profile_id into the
  existing hmget, reducing per-client Redis calls from 3 to 1
- utils.py: collapse 2x and 3x hget per key in scan_iter loops
  (get_user_active_connections) to single hmget calls
- views.py: replace 3x hget on channel metadata in the worker-join path
  of stream_ts with a single hmget
2026-05-20 22:12:12 -04:00
Jonathan Caicedo
e2074c1921 fix: reduce intermittent 503s on stats page and API requests 2026-05-20 21:52:28 -04:00
SergeantPanda
f84265f2a5 Enhancement: add Comskip mode and hardware acceleration settings to DVR configuration. Update default comskip config.
Some checks are pending
CI Pipeline / prepare (push) Waiting to run
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Blocked by required conditions
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
CI Pipeline / create-manifest (push) Blocked by required conditions
Build and Push Multi-Arch Docker Image / build-and-push (push) Waiting to run
Frontend Tests / test (push) Waiting to run
2026-05-19 21:14:06 -05:00