Commit graph

1480 commits

Author SHA1 Message Date
SergeantPanda
0aed30253b refactor(stats): simplify channel logo handling in stats data
This update refactors the logic for building timeshift statistics by removing unnecessary `select_related` calls and the `logo_url` field from the connections. The changes streamline the data retrieval process and ensure that only the `logo_id` is exposed in the session data. Corresponding tests have been updated to reflect these modifications.
2026-07-17 23:21:44 +00:00
SergeantPanda
692f2d27c1 fix(channels): update "Copy URL" functionality to exclude web player parameters
This change modifies the "Copy URL" action in the Channels table to generate a plain proxy URL without including web player output profile parameters. The update ensures that copied links are suitable for external players, enhancing usability. Additionally, tests have been updated to verify the new behavior of the "Copy URL" feature.
2026-07-17 21:52:47 +00:00
SergeantPanda
b91385aacb Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into pr/nagelm/1442 2026-07-17 15:40:28 +00:00
SergeantPanda
5263e18ed9 fix(api): improve error handling for API responses
- Enhanced the `formatApiError` function to better format failed API responses, preventing raw HTML error pages from being displayed in toasts. JSON error bodies are now prioritized for user-friendly messages, while HTML and empty bodies are collapsed to a concise status line. Long plain-text bodies are truncated for readability.
- Updated tests to cover new error formatting behavior, ensuring accurate extraction of error messages from various JSON structures.
2026-07-17 15:31:56 +00:00
SergeantPanda
9ee5ba2535 Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into pr/nagelm/1441 2026-07-17 15:19:35 +00:00
SergeantPanda
1b99f105c4
Merge pull request #1444 from nick4810/tests/frontend-unit-tests
Tests/frontend unit tests
2026-07-17 08:52:42 -05:00
SergeantPanda
8bcc7c9ebe feat(timeshift): enhance catch-up programme handling and UI updates
Some checks are pending
Backend Tests / Plan test groups (push) Waiting to run
Backend Tests / (push) Blocked by required conditions
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
- Updated the catch-up stats UI to advance to the next EPG programme when playback continues past the original programme's end, improving user experience.
- Enhanced the `get_programme_info` function to resolve the guide entry based on the playhead position, ensuring accurate display of the current programme.
- Introduced new utility functions for computing catch-up playback position and checking if the playhead is outside the displayed programme window, optimizing session management.
- Added tests to validate the new functionality and ensure correct behaviour of the catch-up features.
2026-07-16 23:10:06 +00:00
SergeantPanda
6f62d807f4 feat(timeshift): add position reporting for catch-up sessions
- Introduced a new endpoint `POST /api/catchup/sessions/<session_id>/position/` for native clients to report their playhead position and pause state during catch-up sessions.
- Updated the catch-up session handling to include a `paused` flag, allowing accurate tracking of playback state without seeking the provider stream.
- Enhanced the Redis storage mechanism to accommodate the new position and pause data, ensuring real-time updates for admin stats.
- Added tests to validate the new position reporting functionality and its integration with existing catch-up features.
2026-07-16 22:06:27 +00:00
SergeantPanda
cdfe16ae5d fix(schema): resolve Swagger/OpenAPI schema generation issues under concurrent requests
- Implemented a new `LockedSpectacularAPIView` to handle schema generation, ensuring it no longer fails due to concurrent gevent requests. The schema builds are now single-flight per process and cached in Django's cache, allowing all workers to share the result.
- Updated the `urls.py` to use the new view for schema generation, enhancing stability and performance.
2026-07-16 18:57:57 +00:00
SergeantPanda
388c4bd28d Enhancement: update catch-up features and enhance stream ordering logic
Some checks are pending
Backend Tests / Plan test groups (push) Waiting to run
Backend Tests / (push) Blocked by required conditions
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
- Improved multi-provider failover by preferring streams with sufficient catch-up days.
- Added new helper functions for calculating programme age and ordering catch-up streams.
- Removed deprecated XMLTV settings from the frontend and backend.
- Updated tests to validate new stream ordering logic and catch-up functionality.
2026-07-16 15:33:34 +00:00
Nick Sandstrom
817ebf21a9 Added tests for components 2026-07-14 14:21:54 -07:00
Nick Sandstrom
07d17a5ffc Extracted ManageReposModal from PluginBrowse 2026-07-14 14:21:53 -07:00
Nick Sandstrom
99fc71de99 Slight refactoring of components 2026-07-14 14:21:53 -07:00
Nick Sandstrom
f6ad115a1f Added tests for utils 2026-07-14 14:21:53 -07:00
Nick Sandstrom
6d5a5a549a Extracted utils 2026-07-14 14:21:53 -07:00
nagelm
8cb1dab5ce test(frontend): make date assertions machine-independent
Three tests encoded the machine's timezone or locale into their
expectations and fail on any box east of UTC (observed on UTC+12/13;
CI's UTC and US-locale dev machines never see it):

- dateTimeUtils isSame: compared 10:00Z/11:00Z on the 15th as 'same
  day', but isSame works on local calendar days and no UTC instant
  falls on the same date in every timezone (at UTC+13 those are 23:00
  on the 15th and 00:00 on the 16th). Use timezone-less datetimes,
  which mean the same calendar day everywhere.
- RecordingUtils toDateString: formatted a UTC-noon instant and
  expected the UTC date, but toDateString renders local time (UTC+12
  renders the next day). Construct the Date with local components.
- SeriesModalUtils getEpisodeAirdate: the code renders the viewer's
  locale via toLocaleDateString() by design, but the test hardcoded
  the en-US shape (it tolerated the timezone day-shift with /1[4|5]/
  yet not the day/month order). Compute the expectation with the same
  API so the test asserts the wiring, not a specific locale.

No production code changes.
2026-07-14 23:00:04 +12:00
nagelm
ed1c449234 fix(ui): stop rendering raw HTML error pages in toast notifications (#1261)
Failed API responses whose body is not JSON - Django's HTML "Server
Error (500)" page, nginx's HTML 502/504 pages when the backend is down
or timing out - were interpolated verbatim into the error toast,
showing users a wall of markup.

request() deliberately keeps the raw text when JSON.parse fails, and
errorNotification() rendered `${status} - ${body}` unconditionally.
Route the body through a new formatApiError() helper (in utils.js so it
is unit-testable without importing the store-heavy api module):

- JSON object bodies keep their existing pretty-printed formatting
- markup and empty bodies collapse to the response's own status line:
  the declared Content-Type decides what counts as markup (body
  sniffing only as fallback when the header is missing), and the label
  comes from the fetch Response's statusText - the protocol's reason
  phrase, defined for every status code, rather than a hardcoded status
  map. HTTP/2+ transmits no reason phrase, so an empty statusText falls
  back to a generic label. request() already attaches the Response to
  the error, so no call-site changes are needed.
- the full suppressed body goes to console.debug so the markup stays
  available for troubleshooting (deliberate, not a leftover debug
  statement)
- plain-text bodies are truncated at 200 chars as a backstop
- errors without a status keep the error.message fallback
2026-07-14 20:37:58 +12:00
SergeantPanda
58d60bf733 chore(changelog): update CHANGELOG.md to reflect recent enhancements in unit tests and Backup Manager functionality
- Added entry for extended frontend unit tests covering plugin, backup, and settings components.
- Updated Backup Manager to ensure the "Created" column refreshes when date/time format preferences change.
2026-07-12 14:35:05 +00:00
SergeantPanda
d56680cad8
Merge pull request #1424 from nick4810:tests/frontend-unit-tests
Tests/frontend unit tests
2026-07-12 09:27:26 -05:00
SergeantPanda
223dff33ed feat(timeshift): add catch-up playback, stats, and admin APIs
Add end-to-end catch-up support for XC clients and native apps: provider
proxy with failover and per-viewer session pooling, REST session minting
for tokenless playback URLs, catch-up admin stats, combined connection
stats, and Stats UI with dedicated cards plus websocket updates.

Includes Redis namespace consolidation under timeshift:* (dropping legacy
timeshift_ id prefixes), dedicated catch-up stop by session_id, and
cleaner channel/client metadata split for stats keys.

Closes #133
2026-07-11 17:14:31 +00:00
Nick Sandstrom
3c658a6fc6 Fixed mock path 2026-07-09 01:44:14 -07:00
Nick Sandstrom
65fcaa885e Syntax formatting changes 2026-07-08 15:03:03 -07:00
Nick Sandstrom
b228d1cab1 Added tests for components 2026-07-08 15:00:35 -07:00
Nick Sandstrom
71f1c7d5e5 Slight component refactoring 2026-07-08 15:00:35 -07:00
Nick Sandstrom
18f7e8584a Added tests for utils 2026-07-08 15:00:34 -07:00
Nick Sandstrom
92946057c6 Extracted utils 2026-07-08 15:00:34 -07:00
Nick Sandstrom
5849082650 Moved pluginUtils to utils folder 2026-07-08 15:00:34 -07:00
SergeantPanda
9c3ace6146 Enhancement: Introduce 'Only Catch-up' filter in Channels and Streams tables, allowing users to easily narrow down to catch-up entries. Update changelog to reflect this new feature.
Some checks failed
CI Pipeline / prepare (push) Has been cancelled
Build and Push Multi-Arch Docker Image / build-and-push (push) Has been cancelled
Frontend Tests / test (push) Has been cancelled
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Has been cancelled
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Has been cancelled
CI Pipeline / create-manifest (push) Has been cancelled
2026-07-03 09:09:59 -05:00
SergeantPanda
4b0066f6e7 Enhancement: Add catch-up indicators to Channels and Streams tables, enhancing UI with new serializers for catch-up data. 2026-07-03 09:03:28 -05:00
SergeantPanda
27fc812df9 Add comment explaining the Node 25 issue with localStorage. Also patch globalThis. 2026-07-02 14:39:26 -05:00
Nick Sandstrom
e8eec56783 Added localStorage polyfill 2026-06-30 16:27:50 -07:00
SergeantPanda
dafdb1a19b refactor(tests): Improve formatting and structure in ChannelsTable tests; streamline requeryChannels function in ChannelUtils 2026-06-30 16:49:30 -05:00
SergeantPanda
14ab2a0317 Enhance VodConnectionCard to use human-readable duration format and update tests accordingly. Refactor formatDuration function to support 'human' precision and add related unit tests for various duration scenarios. 2026-06-30 16:48:36 -05:00
SergeantPanda
570adc2fe0 Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into pr/nick4810/1393 2026-06-30 12:55:20 -05:00
SergeantPanda
8d5c13bdc1 tests: fix proxy setting test
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-06-30 10:35:03 -05:00
SergeantPanda
968862cad3 refactor(proxysettings): Enhance proxy settings UI by categorizing advanced options and improving documentation. The channel_client_wait_period and channel_init_grace_period are now marked as advanced settings, and the UI has been updated to allow users to expand and view these options. Additionally, the changelog has been updated to reflect these changes and clarify the behavior of grace periods. 2026-06-30 10:08:02 -05:00
SergeantPanda
5c5a79962d refactor(proxy): Add new client connect grace period setting and update channel initialization grace period defaults. The channel_client_wait_period is introduced to manage channel lifetimes before client connections, while the channel_init_grace_period default is increased to improve failover handling.
Some checks failed
CI Pipeline / prepare (push) Has been cancelled
Build and Push Multi-Arch Docker Image / build-and-push (push) Has been cancelled
Frontend Tests / test (push) Has been cancelled
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Has been cancelled
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Has been cancelled
CI Pipeline / create-manifest (push) Has been cancelled
2026-06-28 11:34:44 -05:00
SergeantPanda
fc4ced9043 feat(m3u): Add stream count summary and parsing result handling to M3U refresh process. Introduce helper functions for better readability and maintainability. Update frontend notification to display detailed stream processing outcomes, including counts for created, updated, stale, and removed streams.
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-06-28 09:54:09 -05:00
Nick Sandstrom
fe44af7d38 Updated to use datetime util 2026-06-27 01:55:28 -07:00
Nick Sandstrom
4eb4b9c221 Added tests for components 2026-06-27 01:55:27 -07:00
Nick Sandstrom
68fcbe3e2d Extracted shared component 2026-06-27 01:55:27 -07:00
Nick Sandstrom
28cff8e87b Refactored components 2026-06-27 01:55:27 -07:00
Nick Sandstrom
1a46ca4be4 Added tests for utils 2026-06-27 01:55:10 -07:00
Nick Sandstrom
7a4db31460 Moved functionality to shared util 2026-06-27 01:55:09 -07:00
Nick Sandstrom
f1dde066c0 Extracted utils 2026-06-27 01:55:09 -07:00
SergeantPanda
5a552cd565 refactor(epg): Update xmltv_prev_days_override setting to EPG settings and adjust related logic. Refactor CoreSettings to include a dedicated method for retrieving the override value. Update tests and frontend components to reflect the new structure and ensure consistent behavior across settings management. 2026-06-26 17:48:06 -05:00
SergeantPanda
293745d568 Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into pr/cedric-marcoux/1242 2026-06-25 21:38:35 -05:00
SergeantPanda
fd93c0dc3d fix(channel management): Implement channel initialization grace period handling to ensure proper state transitions during live stream startup. Channels now honor the configured grace period for buffer filling, promoting to active state when conditions are met. Updated related tests and documentation for clarity. (Fixes #1380)
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) Has been cancelled
2026-06-25 14:24:30 -05:00
SergeantPanda
c44cac2e9a fix(recording playback): Complete authentication handling for DVR recordings by allowing JWT tokens via query parameters for both native video and HLS segments. Updated API views to support token propagation in redirects and playlist rewrites. Enhanced tests to validate new authentication behavior across endpoints. 2026-06-25 11:27:57 -05:00
SergeantPanda
562393b77e fix(recording playback): Enhance completed DVR recording playback by allowing JWT token via query parameter for native <video src> support. Updated authentication handling in API views and modified FloatingVideo component to append token dynamically. Updated tests to reflect new API URL structure.
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-06-24 17:32:48 -05:00