Commit graph

86 commits

Author SHA1 Message Date
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
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
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
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
c4972f7dc9 fix: clear previous failure entries after successful logo fetch in LogoViewSet and VODLogoViewSet 2026-04-14 13:34:17 -05:00
SergeantPanda
978714a74d fix: improve remote logo fetching with timeout and caching for failures 2026-04-14 13:04:45 -05:00
dekzter
a19be96ced fleshed out user limits and termination logic 2026-03-25 17:33:26 -04:00
dekzter
99a328ca17 fixed bug when filtering after category was selected 2026-03-19 12:45:01 -04:00
SergeantPanda
dfb91db987 Bug Fix: VOD orphan cleanup crashing with a ForeignKeyViolation (IntegrityError) when a concurrent refresh task created a new M3UMovieRelation or M3USeriesRelation for a movie/series between the orphan-detection query and the DELETE SQL. Both orphaned_movies.delete() and orphaned_series.delete() are now wrapped in try/except IntegrityError; affected records are skipped with a warning and will be cleaned up on the next scheduled run. 2026-03-08 11:56:52 -05:00
SergeantPanda
1791a75f15 Bug Fix: Remove stale episode relations when series relations are deleted as well as remove episodes not seen in current series scan.
Enhancement: Added series_relation FK to M3UEpisodeRelation table to properly link episodes with the m3useriesrelation they came from.
2026-02-24 18:32:48 -06:00
znake-oil
dca72f330e Remove clearing of existing episodes on refresh
These 4 lines were wiping episodes before batch_process_episodes could update them in place, causing new UUIDs to be generated on every refresh.
# batch_process_episodes already handles create vs update correctly using (series, season_number, episode_number) as the stable natural key.
2026-02-24 12:11:19 +01:00
SergeantPanda
d80da75795 Bug Fix: Changed logo comparisons to use logo_id (raw FK integer) instead of logo (related object) to avoid Django's lazy loading, which triggers a database fetch that fails if the referenced logo no longer exists. 2026-01-16 13:50:43 -06:00
SergeantPanda
548098b063 Bug Fix: Fixed VOD refresh failures caused by orphaned logo references: Added validation to detect and clear logo foreign key references when the logo no longer exists in the database, preventing "VODLogo matching query does not exist" errors. Also improved logo assignment logic to properly handle cases where logo URLs exist but logo creation fails, ensuring VOD content updates successfully even when logos are deleted or unavailable. 2026-01-16 11:11:56 -06:00
SergeantPanda
01370e8892 Bug fix: Fixed duplicate key constraint violations by treating TMDB/IMDB ID values of 0 or '0' as invalid (some providers use this to indicate "no ID"), converting them to NULL to prevent multiple items from incorrectly sharing the same ID. (Fixes #813)
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-01-07 16:38:09 -06:00
SergeantPanda
30d093a2d3 Fixed bulk_create and bulk_update errors during VOD content refresh by pre-checking object existence with optimized bulk queries (3 queries total instead of N per batch) before creating new objects. This ensures all movie/series objects have primary keys before relation operations, preventing "prohibited to prevent data loss due to unsaved related object" errors. (Fixes #813)
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-01-06 16:12:50 -06:00
SergeantPanda
6031885537 Bug Fix: M3UMovieRelation.get_stream_url() and M3UEpisodeRelation.get_stream_url() to use XC client's _normalize_url() method instead of simple rstrip('/'). This properly handles malformed M3U account URLs (e.g., containing /player_api.php or query parameters) before constructing VOD stream endpoints, matching behavior of live channel URL building. (Closes #722) 2026-01-04 14:36:03 -06:00
SergeantPanda
1a67f3c8ec Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into pr/patchy8736/796 2026-01-02 09:53:54 -06:00
SergeantPanda
6bd8a0c12d Enhance error logging for invalid season and episode numbers in batch_process_episodes 2026-01-02 09:53:45 -06:00
patchy8736
c57f9fd7e7 Fix episode processing issues in VOD tasks
- Ensure season and episode numbers are properly converted to integers with error handling
- Remove zero-padding from debug log format for season/episode numbers
- Add validation to filter out relations with unsaved episodes that have no primary key
- Add proper logging for skipped relations when episode is not saved to database

These changes address potential crashes when API returns string values instead of integers
and prevent database errors when bulk creation operations fail silently due to conflicts.

Fixes issue #770
2026-01-01 15:57:27 +01:00
Vitek
5a4be532fd Fix VOD category filtering for names containing pipe characters
Use rsplit('|', 1) instead of split('|', 1) to split from the right,
preserving any pipe characters in category names (e.g., "PL | BAJKI",
"EN | MOVIES"). This ensures the category_type is correctly extracted
as the last segment while keeping the full category name intact.

Fixes MovieFilter, SeriesFilter, and UnifiedContentViewSet category parsing.
2025-12-27 00:21:42 +01:00
SergeantPanda
48e7060cdb Bug Fix: VOD episode processing now correctly handles duplicate episodes from the same provider. (Fixes #556) 2025-12-16 15:24:16 -06:00
SergeantPanda
2b58d7d46e Enhancement: Ensure "Uncategorized" categories and relations exist for VOD accounts. This improves content management for movies and series without assigned categories. Closes #627 2025-11-25 17:14:51 -06:00
SergeantPanda
da628705df Separate VOD and channel logos into distinct tables with dedicated management UI
- Created VODLogo model for movies/series, separate from Logo (channels only)
- Added database migration to create vodlogo table and migrate existing VOD logos
- Implemented VODLogoViewSet with pagination, filtering (used/unused/movies/series), and bulk operations
- Built VODLogosTable component with server-side pagination matching channel logos styling
- Added VOD logos tab with on-demand loading to Logos page
- Fixed orphaned VOD content cleanup to always remove unused entries
- Removed redundant channel_assignable filtering from channel logos
2025-11-07 13:19:18 -06:00
SergeantPanda
951af5f3fb Enhancement: Add auto-enable settings for new groups and categories in M3U and VOD components
Bug Fix: Remove orphaned categories for VOD and Series
Fixes #540
Closes #208
2025-10-09 15:28:37 -05:00
SergeantPanda
bc574c272c Bug fix: convert commas to decimals and verify float before saving vod/series to database.
Fixes #526
2025-10-06 19:45:43 -05:00
SergeantPanda
b3debcd014 Fix bug during VOD cleanup where all VODs not from the current m3u scan would be deleted. 2025-09-18 14:14:04 -05:00
SergeantPanda
5e661ea208 Fix VOD page not displaying correct order while changing pages. 2025-09-14 19:27:11 -05:00
SergeantPanda
f8e91155e2 Fix bug: cannot access local variable 'total_chunks' where it is not associated with a value 2025-09-14 15:19:51 -05:00
SergeantPanda
67939ba44b Auto cleanup orphaned vods and series during scan. 2025-09-04 16:57:32 -05:00
SergeantPanda
2026eab7f2 Default VOD categories to disabled. 2025-08-28 13:17:22 -05:00
SergeantPanda
ad774db59e Fixed episode image failing to load. 2025-08-28 11:45:16 -05:00
SergeantPanda
11f54f3cda Fix VOD categories not loading on new accounts without webui refresh. 2025-08-28 11:20:37 -05:00
SergeantPanda
d2b852c9a2 Fix cyclic error with logos loading. 2025-08-28 10:42:42 -05:00
SergeantPanda
b92d7c2c21 Major rework of how logos are handle. We will no longer load logos on login and they will only be loaded into the store when needed. 2025-08-26 13:19:29 -05:00
SergeantPanda
5eedceedc3 Combine migrations. 2025-08-25 17:27:15 -05:00
dekzter
11bc2e57a9 optimized vod parsing, added in vod category filtering, added UI individual tabs for movies vs series VOD category filters 2025-08-25 14:37:20 -04:00
SergeantPanda
3ecd7137ff Added misssing bulk fetch function for vod categories. 2025-08-22 17:12:50 -05:00
dekzter
a19bd14a84 added vod category filtering 2025-08-22 16:59:00 -04:00
SergeantPanda
f1a80c3389 Check for null values before saving to database and scrub empty string. 2025-08-21 16:31:41 -05:00
SergeantPanda
3590265836 Show all available options for VODs and their corresponding quality. 2025-08-21 15:04:47 -05:00
SergeantPanda
a95ed79e93 Handle issue with relations. 2025-08-21 12:24:06 -05:00
SergeantPanda
90eccd6edf When getting detailed VOD and series info if an imdb or tmdb id were added it could have caused duplicate key violations, we now merge the two VOD's deleting the VOD that isn't being accessed at that time to avoid the user getting invalid links. 2025-08-21 11:41:58 -05:00
SergeantPanda
56af468320 Merge migrations 2025-08-21 09:35:25 -05:00
SergeantPanda
24f876d09f Add priority for providers so VOD's can be auto selected based on the priority. 2025-08-20 17:38:21 -05:00
SergeantPanda
d04fdb6f69 Fix categories not linking. 2025-08-19 15:42:30 -05:00
SergeantPanda
9137bd47c9 Switch to pulling ALL vods, series and categories instead of an api call for each category. 2025-08-19 14:53:43 -05:00
SergeantPanda
fa19525ab9 Remove url from movie table and save custom_properties for series. 2025-08-19 11:25:56 -05:00
SergeantPanda
54404339c2 Fix batch processing using simpler method for duplicate detection. 2025-08-19 10:01:37 -05:00