Skip to content

feat(search): add backend-scoped global search - #111

Merged
hotzenplotz5 merged 1 commit into
mainfrom
feature/global-search
Jul 27, 2026
Merged

feat(search): add backend-scoped global search#111
hotzenplotz5 merged 1 commit into
mainfrom
feature/global-search

Conversation

@hotzenplotz5

@hotzenplotz5 hotzenplotz5 commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a backend-scoped global search for Recordings 2 and persisted EPG data.
  • Searches titles, subtitles and normalized persisted people.
  • Adds a mobile live-search launcher directly after the VDR remote entry.
  • Reuses the existing Recordings 2 and EPG detail owners and retains query, result and scroll state.

Architecture

Frontend
  -> VdrSuiteClientApi
  -> GET /api/search
  -> GlobalSearchApiRuntime
  -> GlobalSearchController
  -> GlobalSearchService
  -> GlobalSearchRepository
  -> existing VDR-Suite SQLite database

Normal search GETs use the existing database through a dedicated PRAGMA query_only=ON connection. The browser never calls TVScraper, TMDB, IMDb, RESTfulAPI, SVDRP or SuiteBridge, and search performs no provider resolution.

Search performance hardening

The initial mobile test exposed a real latency problem with 174,164 persisted EPG events. The former query evaluated provider JSON and correlated person subqueries for each event and repeated the scan for count and result selection.

The final implementation now:

  • produces title and person candidates in separate set-based query branches;
  • merges candidates deterministically by backend/channel/event identity;
  • parses no provider JSON during a normal search GET;
  • performs person matching once over the normalized relation instead of per EPG row;
  • returns total count and the page from one statement;
  • retains the backend and EPG time-window bounds;
  • adds a 12-second mobile request timeout so a pathological request shows an understandable error rather than spinning forever.

A regression fixture searches 174,164 synthetic EPG events for both Pulp Fiction and John Travolta and enforces a bounded runtime. Local measurements were approximately 0.1 seconds for those targeted searches and below 0.8 seconds for a deliberately broad two-character query.

API

GET /api/search?backend=<id>&query=<text>&limit=<n>&offset=<n>&from=<epoch>&until=<epoch>
  • minimum query length: 2 folded characters
  • default limit: 20 per group; maximum: 50
  • default EPG window: now minus 6 hours through now plus 14 days
  • maximum explicit EPG window: 31 days
  • deterministic sorting and independent recording/EPG totals and hasMore
  • unknown or disabled backends are rejected before repository access

Frontend

  • 280 ms debounce
  • AbortController, request-generation guard and 12-second timeout
  • visible empty, too-short, loading, timeout/error and no-result states
  • grouped Aufnahmen, EPG and optional person summaries
  • Recordings 2 cards and existing Recordings 2 detail owner
  • existing EPG detail owner
  • responsive smartphone dialog and scroll behavior

The VDR remote and EPG timeline are unchanged. The old recording browser is not used.

PR #101 assessment

The conflicting old patch was not copied. Current main already has the consistent 128-person / 65,535-byte contract and its regression model keeps all 52 Pulp Fiction people, including John Travolta beyond the former 12-person cutoff. A future increase must update plugin, transport, backend parser and tests together.

Validation

Passed locally and in the publishing workflow:

  • make test-global-search
  • 174,164-event performance regression
  • frontend stale-response and timeout tests
  • architecture contract checks
  • make test-docs
  • git diff --check

Previously completed targeted validation also covers API routing, HTTP/install staging, Recordings 2, genre frontend, VDR remote, EPG timeline and daemon compilation paths. GitHub Actions is triggered again on the final one-commit branch.

@github-actions
github-actions Bot force-pushed the feature/global-search branch from ecf6f7d to 45d2fbf Compare July 26, 2026 21:08
@hotzenplotz5 hotzenplotz5 reopened this Jul 26, 2026
@github-actions
github-actions Bot force-pushed the feature/global-search branch from ca43ed4 to 0aeabb5 Compare July 26, 2026 21:14
@hotzenplotz5 hotzenplotz5 reopened this Jul 26, 2026
@github-actions
github-actions Bot force-pushed the feature/global-search branch from 42961cf to a4043a7 Compare July 26, 2026 21:17
@hotzenplotz5 hotzenplotz5 reopened this Jul 26, 2026
@github-actions
github-actions Bot force-pushed the feature/global-search branch from c0c7c17 to 67adf21 Compare July 27, 2026 03:48
@hotzenplotz5 hotzenplotz5 reopened this Jul 27, 2026
@hotzenplotz5
hotzenplotz5 marked this pull request as ready for review July 27, 2026 03:53
@hotzenplotz5
hotzenplotz5 merged commit 44ae310 into main Jul 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant