Commit Graph
84 Commits
Author SHA1 Message Date
euzuandGitHub 5b49ea58d8 BPlusTree refactoring / optimization (#792)
* BPlusTree refactoring / optimization
New Features
- Added streaming JSON/CBOR “try” array responses that stop at the first failure, with coalesced HTTP chunking for smoother delivery.
- Introduced B+Tree v3 persistence (with v2→v3 migration) including verified atomic updates, snapshots, compaction, and batch operations.
- Updated playlist/index streaming to use sorted-index acceleration with corruption-safe fallback.

Bug Fixes
- Corrupt/unreadable Library databases now surface repository errors instead of appearing empty.
- Playlist/lineup/EPG/Xtream/M3U streaming now propagates per-entry failures correctly (including improved counting/early-stop behavior).

Documentation
- Updated README and changelog to reflect the B+Tree v3 format and migration behavior.
2026-07-17 17:56:29 +02:00
knylbyteandGitHub c70fbc671e feat: hls content encoding support and shared session between different targets (#789)
* feat: key shared hls sessions by origin id
* feat: support hls content encoding
* fix: coderabbitai findings
* Fix: Custom headers are lost on provider://
In the manual redirect path, the abstract provider:// URL is compared against the resolved HTTP URL.
This causes the request to be marked as "scrubbed" before the first real redirect even occurs, stripping out headers like X-API-Key.
2026-07-15 10:40:30 +02:00
knylbyteandGitHub 9040940674 feat: ics to xmltv exporter (#784)
feat: ics to xmltv exporter
2026-07-10 14:53:33 +02:00
knylbyteandGitHub dc49189f63 feat: add shared hls cache sessions (#782)
Shared HLS cache session feature and aligns the runtime, cache, provisioning, recovery, custom-response, and documentation paths with the new shared-session model.
2026-07-08 11:52:22 +02:00
euzuandGitHub bfcd66ffcc Fix/catchup (#778)
* Fix: setting auth web_ui token_ttl_mins = 0 fixed.
* Fix: catchup
* New: added playlist update log view
* Fix: Landing Page
New: "Last Page"  added for Landing Page selection
2026-06-18 16:03:09 +02:00
euzuandGitHub 9e83d24864 Feature/optimizations (#777)
* perf: binary-search EPG programme lookup
Replaces the linear position() scan with a binary search via partition_point for EPG programmes. Reduces complexity to O(log p).
* perf: cache interned PlaylistItemType label
Avoids repetitive hash-map lookups during sorting and filtering. The five fixed labels are now interned once via OnceLock and returned as a cheap Arc clone.
* perf: avoid per-event String allocation in web-UI XMLTV parser
Uses borrowed Cow types instead of allocating a new String for every element name. Tracks the active text state using a small TextTag enum.
* perf: throttle per-chunk download control poll
Throttles the control_signal lock polling to a 200ms interval on multi-GB downloads to prevent CPU thrashing. Immediate actions (pause/cancel) remain guaranteed via control_notify.
* perf: pre-size filtered channel buffers in apply_filter_to_playlist
Pre-allocates the filtered channel vector based on the source group length. Eliminates step-by-step reallocations on large playlists.
* fix: surface playlist cache load failures instead of silent empty fallback
Replaces silent error swallowing with real error logging (distinguishing missing files from corruption) while preserving the empty fallback behavior.
* perf: remove redundant first drain loop in get_remote_content_as_file
Removes a dead, redundant loop. The stream body is now consumed only once, allowing the idle timeout to protect the transfer correctly.
* perf: back off instead of busy-spinning on empty client-stream chunks
Introduces a short Sleep backoff (Poll::Pending) when a provider sends continuous empty keep-alive chunks. Prevents the CPU from spinning hot.
* perf: make library orphan cleanup linear instead of O(n^2)
Reduces the complexity of cleaning up orphaned entries from O(n^2) to linear O(n). Loads the metadata library only once and pre-computes partitions.
* perf: indexed batched merge for series expansion instead of O(n^2) scans
Replaces expensive O(n^2) scans during series expansion with index-based batch processing. Builds temporary lookup indexes and merges groups linearly.
* perf: pre-size group flatten buffers to reduce reallocation churn
Pre-allocates target merge vectors and category indexes to eliminate repeated memory reallocations when flattening large target playlists.
* perf: stream custom provider playlist endpoint instead of materializing it
Switches from full in-memory materialization to lazy conversion and streaming of JSON/binary responses. Massively reduces the memory footprint.
* refactor: centralize InputType batch/family checks behind enum helpers
Moves scattered matches! checks for M3u/Xtream types into centralized enum helpers (is_batch(), etc.) to prevent logic drift.
* refactor: centralize XMLTV tag/attribute literals into named constants
Replaces hardcoded inline strings in the XMLTV parser with named constants (EPG_TAG_TITLE, etc.) as a single source of truth.
* refactor: derive GeoIpUpdateError Display/Error via thiserror
Replaces manual Display and Error implementations with the thiserror macro, allowing new error variants to self-document their formatting.
* refactor: attach per-cluster facts to XtreamCluster instead of scattered matches
Centralizes redundant API actions and collection name mappings directly onto the XtreamCluster struct instead of using scattered match blocks.
* refactor: centralize PlaylistItemType video/series classification
Introduces is_video() / is_series() on the enum to unify duplicate matches! checks across filters, probes, and tracking modules.
* feat: add per-stage summary logs to VOD/series resolve queueing
Adds a concise debug summary per processing stage (total counters and elapsed time) to make hot-path diagnostics easier without raising the log level.
* refactor: generate ItemField get/set from a single direct-field list
Uses a callback macro to synchronously generate both getter and setter blocks for directly-bound fields (Name, Url, etc.) from a single master list.
* refactor: derive input-type routing from a single capability descriptor
Bundles InputType behaviors (backends, connection rules) into a single capabilities() descriptor to prevent bugs when adding new variants.
* refactor: derive output-format routing from a single capability descriptor
Centralizes output format features (filter, EPG, and cache support) into a single TargetCapabilities descriptor instead of spreading logic across no-op match arms.
2026-06-15 14:09:31 +02:00
euzuandGitHub c1f0063e07 Feature/show local time (#773)
* Fixed sanitizing url scheme batch and provder
* local date in Stream history
* Fixed EPG programme time display to render in local timezone for improved readability.
* Improved stream history date range filtering to accurately use local date boundaries.
* Enhanced credential sanitization for stream URLs to properly mask sensitive information.
* Fix EPG path selection for mixed Xtream/M3U targets
* Fix EPG selection and complete Xtream series_info for input/custom requests
* Add configurable interner GC tuning
2026-06-08 11:55:51 +02:00
euzuandGitHub a2d9c1e076 Feature/user playlist range select and code deduplication (#772)
* refactored some code duplications
* User playlist editor shift+mouse selektion added
* added russion translation
2026-06-06 13:06:28 +02:00
euzuandGitHub 4c5d966248 Reduce heap allocation (#764)
- Refactored PlaylistSource to avoid Box<dyn> whre possible
- Some other small heap allocation fixes
2026-05-28 17:58:41 +02:00
euzuandGitHub 1a7f2db080 reconnect refactor (#758)
* reconnect refactor
2026-05-14 22:43:05 +02:00
euzuandGitHub 523149d8ac Fix stream session problems (#756)
* Fix stream session problems
2026-05-11 19:27:04 +02:00
Juanjo PresaandGitHub 15e4857d4c build: remove vendored OpenSSL dependency (#743)
* build: remove vendored OpenSSL dependency
* remvoed unnecessary comments and clippy fixes
2026-05-04 19:07:41 +02:00
euzuandGitHub 02ac40f592 Feature/provider url selection strategy (#712)
* Input provider url selection strategy
* CVD friendly theme
* Fix: HLS Stream session info  duration and total trasferred data
2026-04-10 11:32:56 +02:00
euzuandGitHub f4a9f41377 fix provider:// scheme (#711)
fix: provider:// scheme
2026-04-09 22:06:01 +02:00
euzuandGitHub 31a48bc1f3 Feature/structured errors landing page (#705)
- structured errors
- landing page
- fix: table header background
2026-04-06 10:20:52 +02:00
euzuandGitHub 6c32deb4c3 Stream History (#667)
Stream history qos
2026-04-02 20:03:49 +02:00
euzuandGitHub 9d35a9cbbe Sorce ordinal by category and channel index (#672)
* Sorce ordinal by category and channel index
* Parsing UserApiRequest from request body or query
* CSS stylings
* media tools refactoring
* xtream info parsing now number/string fields
2026-03-27 15:23:39 +01:00
euzuandGitHub 6909fa0f25 Fix/stream upstream error status (#653)
* stream upstream error diagnostics
* fixed config view forms because of yew hook changes
2026-03-18 19:20:36 +01:00
euzuandeuzu 31438c64b2 Feature/optimizations (#642)
* - Refactored Shared-Stream hot path from Arc<Bytes> to Bytes (leveraging internal reference counting).
- Switched Metadata Trigger deduplication from Arc<Mutex<HashSet<_>>> to Arc<DashSet<_>> to reduce lock contention.
- Eliminated expensive key cloning in the InputMetadataUpdatesCompleted handler.
- Changed active_target_inputs to HashSet<Arc<str>> to avoid per-event to_string() allocations.
- Implemented bounded Cleanup-Queue (switched from unbounded to mpsc::channel(4096)) with a dedicated overflow path (try_send + async flush) to prevent uncontrolled memory growth.
- Optimized by_provider storage by switching from Vec<(addr, alloc_id)> to HashSet<(addr, alloc_id)>, reducing removal complexity from $O(n)$ to $O(1)$ average.
- Optimized ActiveConnectionInfo data layout by reordering fields (large fields first) to minimize padding and improve cache efficiency.

* Improve shared-stream reliability and align docs

- make shared connection registration fallible with rollback on failure

- guard shared broadcaster startup behind successful subscription

- optimize shared stream/provider key maps to Arc<str>

- add Tokio macros feature for runtime and dev dependencies

- harden build_resources.sh with fail-fast ffmpeg error handling

- clarify StreamError display messages with variant context

- sync README stream/custom-response sections with current behavior

* low_priority_preempted stream
* Keep custom TS timestamps monotonic across loops
- advance timestamp offset by stream duration on buffer wrap
- avoid resetting PTS/DTS to zero each cycle
- prevents players from treating looped custom streams as ended/corrupt
* low_priority_preemption custom video stream fix
* inc_version uses now main toml file
* Fixed some coderabbit issues
2026-03-13 15:17:20 +01:00
knylbyteandeuzu ba53629211 fix: format ipv6 dns targets correctly for http (#641)
fix:  format ipv6 dns targets correctly for http
2026-03-13 15:17:20 +01:00
knylbyteandGitHub c2fdf50642 Feature/dns resolver (#638)
* fix: log resolved provider URLs across stream flows

* fix: split request and provider-key stream logging

* fix: avoid consuming dns rotation in log preview

* test: cover https dns log preview rotation
2026-03-10 13:49:52 +01:00
euzuandGitHub 737d04d08b Feature/staged input and path improvements (#632)
* No template file not found error message
* Setup wizard improvmenets
* path improvements
* staged input fix
* path improvements
* Provider dns resolved ips now writing to a file instead of source.yml
* Playlist update hard kill after 1h
* matadata update tmdb fix
* Web UI fixes
* GeoIp update schedule
* batch:// prefix  for aliases
2026-03-06 17:29:42 +01:00
knylbyteandGitHub c5632d0c98 fix: log resolved request URLs instead of provider scheme (#631)
* fix: log resolved request URLs instead of provider scheme
* fix: resolve provider log URLs only when sanitization is enabled
* fix: trigger provider failover on http 407
* fix: documentation for provider failover trigger
* moved resolve url into debug statement to avoid building it when log level i not debug
2026-03-06 11:37:20 +01:00
knylbyteandGitHub faac89325b feat: add provider DNS IP-connect, resolved persistence, and SNI-safe failover (#624)
* feat: add provider DNS IP-connect, resolved persistence, and SNI-safe failover
2026-03-02 12:24:05 +01:00
knylbyteandGitHub f8ae4c9d56 fix: use manual redirects only for http proxies and apply proxy setting to ffprobe subprocess (#612)
* fix: use manual redirects only for http proxies
* fix: sync panel api on manual playlist update
* fix: route ffprobe probes through configured proxy
* fix: handle non-unicode proxy env vars safely
* fix: serialize panel api sync and align sync naming
* fix: manually follow hls redirects when proxy is configured
* fix: align hls manual redirect with proxy scheme
* fix: emit playlist update failure when lock is closed
* fix: align probe and scheduler paths for upstream merge
* fix: remove playlist lock retry and name hls redirect limit
2026-02-26 20:36:01 +01:00
euzuandGitHub 815487e4f5 Fix/peristed m3u file invalid provider url (#595)
Fixed m3u playlist with  provider_config persistence as text file
Added probe_delay input option (default 2s); stream probing renamed “Stream Probing” and now covers live, VOD and series as a low‑priority background task.
2026-02-18 08:18:28 +01:00
euzuandGitHub 7b8bdaa49b Feature/stream probe (#585)
Stream probe
2026-02-14 17:52:35 +01:00
euzuandGitHub fc0f1f32aa Enhanced Metadata Resolution, Stream Analysis & Improved STRM-Output. Added connection priority management.
**Description:**
This PR introduces a major overhaul of how streams are analyzed and connections are managed. It integrates `ffprobe` for deep stream analysis, adds a background task queue for metadata resolution to prevent UI blocking, introduces a connection priority system, and adds support for Live TV probing.

### 🚀 Key Features

*   **FFprobe Integration & Live TV Probing**:
    *   Automatically probes streams (VOD/Series **and now Live TV**) to determine resolution, codecs (HEVC/AV1), dynamic range (HDR/DV), bit depth, and audio channels.
    *   **Safe Probing**: Probing strictly respects the provider's `max_connections` limit.
    *   Docker images now include static `ffmpeg/ffprobe` binaries.

*   **Smart Connection Management (Priority System)**:
    *   Introduced a priority system for connections to manage provider limits intelligently.
    *   **Preemption**: Users with higher priority can preempt (kick) lower priority connections when provider slots are full.
    *   **Background Queue**: Metadata resolution and stream analysis run as background tasks (Priority 0). They only run when connection slots are idle and yield immediately if a real user needs to stream.

*   **Enhanced Metadata Resolution**:
    *   **Fallback Logic**: If a provider is missing the TMDB ID or Release Date, the system resolves them via the TMDB API.
    *   **Smart Title Cleaning**: Implemented a centralized cleaner to strip common IPTV prefixes before attempting metadata matches or generating filenames, significantly improving match rates.

*   **Improved Output**:
    *   **Quality Tags**: Filenames in STRM files now include detailed tags (e.g., `Movie - [4K HEVC HDR].strm`).
    *   **Flat Grouping**: `flat: true` now correctly groups multi-version movies into single folders based on TMDB ID.
    *   **Global Series Date**: Ensures consistent series folder naming even if episodes have different years.
2026-02-12 15:06:57 +01:00
euzuandGitHub 555bc2cce1 Feature/provider config (#570)
New Features
- Automatic provider failover & rotation across multiple provider URLs with a provider:// scheme and capped retries
- Configurable failover redirect patterns to influence retry/failover behavior
UI

- New interface to view and edit failover redirect patterns in reverse proxy configuration

- Expanded docs covering Provider Failover & Rotation and enriched messaging templating
Reliability

- Improved URL resolution, error reporting and logging for more robust provider handling
2026-02-10 11:53:42 +01:00
knylbyteandGitHub 7bcb9c17c3 Bugfix/proxy auth (#557)
gitignore added debug directory and codex instructions STEPS.md
fix: preserve proxy auth across redirects
fix: fail when proxy client build fails
fix: keep no-redirect fallback policy
fix: drop auth headers on cross-origin redirects
fix: ignore NO_PROXY for redirect handling
Fix redirect fails proxy authentification
2026-02-01 13:37:49 +01:00
euzuandGitHub 748fca44b3 Feature/request timeout and web UI updates (#555)
* Idle timeout for requests implemented
* fix: user api path
* WebUI Added APi Proxy Config
2026-01-31 15:29:32 +01:00
euzu 6ae663f024 New Features
Aliases can now be individually enabled or disabled to manage active sources.

Bug Fixes
Improved channel identification accuracy in XMLTV outputs.

Style
Disabled aliases display with strikethrough text for better visibility.
2026-01-26 17:44:32 +01:00
euzuandGitHub 9a6b7e574b epg fix (#537)
New Features
Aliases can now be individually enabled or disabled to manage active sources.

Bug Fixes
Improved channel identification accuracy in XMLTV outputs.

Style
Disabled aliases display with strikethrough text for better visibility.
2026-01-26 17:37:01 +01:00
euzuandGitHub 62f7611125 Feature/log fixes and button styling (#536)
fixed some logs, added input name
epg short response hos now no errors field
added missing fields for reverse_proxy and library config in ui
fixed button styling
2026-01-25 16:32:35 +01:00
euzuandGitHub a407f209a8 Messaging templates (#534)
Messaging templates
2026-01-25 12:41:18 +01:00
euzu ccdbf1dfce Retry request from reverseproxy retry options 2026-01-22 13:30:59 +01:00
euzuandGitHub cc2e50549d Feature/panel api update (#524)
Panel Api update
2026-01-20 18:51:46 +01:00
euzuandGitHub 16fcd7f882 Optimizations
* New Features

Added series information display with episodes, cast, and metadata in playlist explorer
Introduced multi-cluster playlist endpoints (live, VOD, series) for flexible content retrieval
Added series info lookup and filtering capabilities
Implemented sidebar navigation for source editor with dedicated pages (Main, Options, Staged, Advanced, Alias)
Added filter state controls (All, Selected, Deselected) for playlist category management
Enabled Trakt configuration toggle to control integration
Performance Improvements

Optimized B+Tree indexing for faster queries
Reduced startup latency with disk-based operations and optional memory caching
Improved string memory handling through efficient reference-counted strings
UI Enhancements

Enhanced playlist explorer with series details and episode grouping by season
Added new UI icons (Options, Advanced, Staging, Alias, Trakt)
Improved form layouts with toolbar controls
Enhanced radio button group styling for better visual hierarchy

* New Features

Added series information display with episodes, cast, and metadata in playlist explorer
Introduced multi-cluster playlist endpoints (live, VOD, series) for flexible content retrieval
Added series info lookup and filtering capabilities
Implemented sidebar navigation for source editor with dedicated pages (Main, Options, Staged, Advanced, Alias)
Added filter state controls (All, Selected, Deselected) for playlist category management
Enabled Trakt configuration toggle to control integration
Performance Improvements

Optimized B+Tree indexing for faster queries
Reduced startup latency with disk-based operations and optional memory caching
Improved string memory handling through efficient reference-counted strings
UI Enhancements

Enhanced playlist explorer with series details and episode grouping by season
Added new UI icons (Options, Advanced, Staging, Alias, Trakt)
Improved form layouts with toolbar controls
Enhanced radio button group styling for better visual hierarchy

* New Features

Added series information display with episodes, cast, and metadata in playlist explorer
Introduced multi-cluster playlist endpoints (live, VOD, series) for flexible content retrieval
Added series info lookup and filtering capabilities
Implemented sidebar navigation for source editor with dedicated pages (Main, Options, Staged, Advanced, Alias)
Added filter state controls (All, Selected, Deselected) for playlist category management
Enabled Trakt configuration toggle to control integration
Performance Improvements

Optimized B+Tree indexing for faster queries
Reduced startup latency with disk-based operations and optional memory caching
Improved string memory handling through efficient reference-counted strings
UI Enhancements

Enhanced playlist explorer with series details and episode grouping by season
Added new UI icons (Options, Advanced, Staging, Alias, Trakt)
Improved form layouts with toolbar controls
Enhanced radio button group styling for better visual hierarchy

* New Features

Added series information display with episodes, cast, and metadata in playlist explorer
Introduced multi-cluster playlist endpoints (live, VOD, series) for flexible content retrieval
Added series info lookup and filtering capabilities
Implemented sidebar navigation for source editor with dedicated pages (Main, Options, Staged, Advanced, Alias)
Added filter state controls (All, Selected, Deselected) for playlist category management
Enabled Trakt configuration toggle to control integration
Performance Improvements

Optimized B+Tree indexing for faster queries
Reduced startup latency with disk-based operations and optional memory caching
Improved string memory handling through efficient reference-counted strings
UI Enhancements

Enhanced playlist explorer with series details and episode grouping by season
Added new UI icons (Options, Advanced, Staging, Alias, Trakt)
Improved form layouts with toolbar controls
Enhanced radio button group styling for better visual hierarchy
2026-01-20 10:09:58 +01:00
euzu 6f776782f1 Playlist Update Optimization: Reduced Memory Usage
An optimization has been introduced to reduce memory consumption during playlist updates.

Overview
Previously, provider playlists were fully loaded into memory during the update process. For large playlists (e.g. hundreds of thousands of entries or multiple providers), this could result in significant RAM usage.
With the new implementation, it is now possible to optionally read provider playlists directly from disk instead of keeping them entirely in memory.

How It Works
 - users can configure whether:
     - Provider playlists are loaded into memory (previous behavior), or
     - Provider playlists are streamed to/from disk to minimize RAM usage.

Processing remains sequential and batch-based, ensuring identical functional behavior.
This approach significantly lowers peak memory usage, especially on systems with limited resources.

Benefits

- Reduced peak RAM consumption during playlist updates
- Better scalability for large playlists and multiple providers
- Full backward compatibility

Trade-offs / Drawbacks

 - Increased processing time due to reduced in-memory caching
 - Higher disk I/O usage, especially for large or fragmented playlists
 - Performance depends more strongly on disk speed (Nvme SSD, HDD)
 - Slightly increased CPU overhead due to repeated parsing and deserialization
 - Not optimal for environments where fast updates are more important than memory usage

Recommendation

 - Use in-memory mode for systems with sufficient RAM and a focus on update speed
 - Use disk-based mode for large playlists, multiple providers, or memory-constrained environments
2026-01-08 15:54:12 +01:00
euzu 8cc9283a31 Playlist Update Optimization: Reduced Memory Usage
An optimization has been introduced to reduce memory consumption during playlist updates.

Overview
Previously, provider playlists were fully loaded into memory during the update process. For large playlists (e.g. hundreds of thousands of entries or multiple providers), this could result in significant RAM usage.
With the new implementation, it is now possible to optionally read provider playlists directly from disk instead of keeping them entirely in memory.

How It Works
 - users can configure whether:
     - Provider playlists are loaded into memory (previous behavior), or
     - Provider playlists are streamed to/from disk to minimize RAM usage.

Processing remains sequential and batch-based, ensuring identical functional behavior.
This approach significantly lowers peak memory usage, especially on systems with limited resources.

Benefits

- Reduced peak RAM consumption during playlist updates
- Better scalability for large playlists and multiple providers
- Full backward compatibility

Trade-offs / Drawbacks

 - Increased processing time due to reduced in-memory caching
 - Higher disk I/O usage, especially for large or fragmented playlists
 - Performance depends more strongly on disk speed (Nvme SSD, HDD)
 - Slightly increased CPU overhead due to repeated parsing and deserialization
 - Not optimal for environments where fast updates are more important than memory usage

Recommendation

 - Use in-memory mode for systems with sufficient RAM and a focus on update speed
 - Use disk-based mode for large playlists, multiple providers, or memory-constrained environments
2026-01-08 15:11:12 +01:00
euzu e5e94a5f28 Fix stream session poisoning and correct headers handling 2026-01-04 10:54:41 +01:00
euzu 1abf9e81c8 Updated database structure
- Using Slotted Pages
- Using compression
- Using file locking to prevent race conditions
2025-12-29 13:46:55 +01:00
euzu d5207e886f stream properties refactored 2025-12-26 14:09:44 +01:00
euzu 76bde0fcc4 stream properties refactored 2025-12-22 21:00:58 +01:00
euzu 19b8153fa5 stream properties refactored 2025-12-22 18:00:42 +01:00
euzu 37985c0324 Integrate local movie file into playlist 2025-12-16 16:43:11 +01:00
euzu 73017363cc xtream and m3u parsing with streaming 2025-12-12 16:10:08 +01:00
euzu 2738f8b7f3 xtream and m3u parsing with streaming 2025-12-12 15:49:10 +01:00
euzu ee0441877d xtream and m3u parsing with streaming 2025-12-12 15:33:41 +01:00
euzu 80660312e4 write operations optimized for less memory usage 2025-12-11 20:02:20 +01:00