Spencer Morris
← Project index
ENGINEERING NOTES / 16 4 MIN READ

DebridFlix

A personal media interface with capability-aware source selection, range caching, FFmpeg playback fallbacks, and persistent viewing state.

Personal software
DebridFlix home screen with movie artwork, navigation and catalog rowsView full size ↗
Running DebridFlix app with a fresh local database and public catalog metadata. No playback account or private viewing history was loaded. This captures catalog browsing, not a successful stream.
01 / THE PROBLEM

What needed solving.

A single media library must work across browsers with different codecs, range-request behavior, remotes, and network bandwidth. Playback also needs resumable sessions, source selection, subtitles, and resilient recovery without relying on a single browser capability profile.

02 / SYSTEM OUTLINE
  1. 01Catalog + browser capabilities
  2. 02Source selection + range streaming
  3. 03Resumable player

Simplified from the implementation and project notes.

03 / TECHNICAL DECISIONS

How it fits together.

Source selection combines browser, audio and network constraints

The catalog/provider layer supplies candidate sources; the client reports browser codec capabilities and the picker ranks only playable, non-blocked sources with English audio. It estimates bitrate from file size and runtime, then weighs connection fit, resolution, cache availability, audio channels and conversion cost. Automatic playback is limited to fitting versions at 720p or better, with a small retry set before asking the user. Tests cover codec parsing, language hints, resolution and bandwidth ranking, unknown size, blocked/uncached availability and smaller-version choice.

Range reads are coalesced and cached across the browser and FFmpeg

A local server mediates byte-range reads. It stores 256 KiB blocks under a 512 MiB LRU budget, joins nearby readers to an in-flight upstream fetch, reads ahead for playback, limits concurrent upstream requests and retries transient failures. A changed source URL clears old blocks because a provider may return different bytes. Tests exercise range parsing and cache behavior; the important failure cases are upstream refusal/expired links, ignored or malformed ranges, short reads, silent connections and a new URL replacing cached content.

Playback falls back through remux and HLS while preserving progress

When the browser cannot decode a source directly, FFmpeg copies video and converts the selected audio track to AAC; HEVC is tagged hvc1 for MP4 compatibility. Safari can use HLS fragments, while sessions retain playback position for resume and expose source alternatives after repeated stalls. Seeking restarts conversion near the target and relies on the range cache for indexed reads. Server tests cover route/session behavior and FFmpeg-dependent response paths; device codec support remains runtime-specific, so a passing unit test does not prove playback on every TV.

FEATURE WALKTHROUGH

Inside the software.

A media client spanning video playback, ebooks, music libraries, and discovery. Its experimental Story DNA pipeline adds structured story profiles to the catalog. Screenshots use a fresh local library; the book and audio samples were created for this walkthrough.

01 / FEATURE

Video discovery and resumable playback

Browse and search movie and TV catalogs, open title and episode pages, pick a source, and resume playback from saved progress.

HOW IT WORKS

React client and TypeScript/Bun API; profile-scoped progress and My List in SQLite; episode ordering, player sessions, source picker and recovery paths.

Implemented; actual stream requires configured provider/account and compatible media source.

Implementation references
  • debrid-flix/README.md
  • debrid-flix/src/pages/Home.tsx
  • debrid-flix/src/pages/Title.tsx
  • debrid-flix/src/pages/VideoPlayer.tsx
  • debrid-flix/src/pages/SourcePicker.tsx
  • debrid-flix/server.ts
  • debrid-flix/src/playback.ts
02 / FEATURE

Capability-aware streaming and recovery

Select among available versions using codec support, audio, bitrate, cache state and device fit; provide alternatives when playback stalls.

HOW IT WORKS

Client codec and bandwidth detection feeds a ranking picker. Server range cache coalesces nearby 256 KiB reads under a 512 MiB LRU; FFmpeg remux/HLS paths cover browser limitations, with source changes invalidating cached bytes.

Source includes unit/server tests; per-device codec success remains environment-dependent.

Implementation references
  • debrid-flix/src/pick.ts
  • debrid-flix/src/codecs.ts
  • debrid-flix/src/bandwidth.ts
  • debrid-flix/server/rangecache.ts
  • debrid-flix/server/remux.ts
  • debrid-flix/test/server.test.ts
  • debrid-flix/src/pick.test.ts
03 / FEATURE

Profiles and kids mode

Separate watch progress, lists, reading progress and YouTube preferences by profile, with optional service sections and a rating-limited kids profile.

HOW IT WORKS

Profile selection is persisted locally and passed on API requests; kids mode applies rating allowlists and alternate home rows. Profiles are identity/preferences partitions, not password accounts.

Present in the reviewed source.

Implementation references
  • debrid-flix/README.md
  • debrid-flix/server/profiles.ts
  • debrid-flix/src/pages/Profiles.tsx
  • debrid-flix/src/profile.ts
  • debrid-flix/src/store.ts
04 / FEATURE

Catalog and story-led discovery

Filter IMDb catalog by genre, decade, ratings and story attributes; accept typed descriptions as structured filters and show related story rows on title pages.

HOW IT WORKS

URL-backed filter state; IMDb advanced search and a SQLite story index. Story filter choices are drawn from profiled titles; semantic matching uses locally stored vectors when available.

Implemented discovery flows; underlying story profiles have partial coverage and background enrichment.

Implementation references
  • debrid-flix/README.md
  • debrid-flix/server/discover.ts
  • debrid-flix/src/pages/Discover.tsx
  • debrid-flix/server/story.ts
  • debrid-flix/server/storydna.ts
  • debrid-flix/server/db.ts
05 / FEATURE

Taste-based home rows

Build profile-specific recommendations from watched titles and My List, including continue watching, new episodes, similar titles and taste-based rows.

HOW IT WORKS

Taste weights title completion, recency and list saves across genre, people and story features; scores candidate rows and diversifies results. IMDb/catalog data is cached locally.

Implemented; recommendation quality depends on available history and profile coverage.

Implementation references
  • debrid-flix/README.md
  • debrid-flix/server/taste.ts
  • debrid-flix/server/morelike.ts
  • debrid-flix/server/imdb.ts
  • debrid-flix/src/pages/Home.tsx
06 / FEATURE

Story DNA analysis

Generate structured story profiles covering story type, plot, arc, stakes, devices, themes, motifs and tone, with source citations and uncertainty readings.

HOW IT WORKS

Pilot pipeline combines Wikipedia, IMDb plot/keywords/reviews and model judgments; stores source text and candidate readings, validates claims against quotes, and exposes profiles on title pages.

Implemented pilot/research feature. README reports evaluation on a small curated set; its model-generated profiles remain experimental.

Implementation references
  • debrid-flix/README.md
  • debrid-flix/server/storydna.ts
  • debrid-flix/server/story.ts
  • debrid-flix/src/pages/Story.tsx
07 / FEATURE

Books library and reader

Browse a book library and read supported ebook and comic formats with saved reading position.

Books library and reader in the running debrid-flix interfaceView full size ↗
The actual EPUB reader displaying a locally authored sample book, with reading progress and a chapter-time estimate. No private library content is shown.
HOW IT WORKS

Dedicated Books and Reader routes use vendored Foliate.js readers, PDF.js and format modules; profile-scoped reading progress is persisted separately from video progress.

Implemented; local library/provider ingestion depends on configuration.

Implementation references
  • debrid-flix/src/pages/Books.tsx
  • debrid-flix/src/pages/Reader.tsx
  • debrid-flix/vendor/foliate-js/view.js
  • debrid-flix/vendor/foliate-js/epub.js
  • debrid-flix/vendor/foliate-js/comic-book.js
  • debrid-flix/server.ts
08 / FEATURE

Music library and player

Browse and play music with a dedicated music surface and profile-specific activity.

Music library and player in the running debrid-flix interfaceView full size ↗
The actual playlist screen with six locally generated audio samples and synthetic cover art. Track names, artists, and albums are fixtures.
HOW IT WORKS

Separate music page/player logic and server API integrate configured catalog/source add-ons; music state is available to discovery and profile preferences.

Implemented; source availability depends on configured integrations.

Implementation references
  • debrid-flix/src/pages/Music.tsx
  • debrid-flix/src/music.ts
  • debrid-flix/src/pages/Player.tsx
  • debrid-flix/src/pages/SongSearch.tsx
  • debrid-flix/src/addons.ts
09 / FEATURE

Music discovery and analysis tools

Explore song search, recommendations and analysis views including Song DNA, trends, taste and X-ray pages.

HOW IT WORKS

Dedicated pages expose discovery and analysis surfaces backed by server modules and configured music sources; related analysis routes are distinct from basic playback.

Implemented UI and supporting routes; third-party data/source coverage varies. Analysis accuracy has not been independently evaluated.

Implementation references
  • debrid-flix/src/pages/SongDna.tsx
  • debrid-flix/src/pages/SongTrends.tsx
  • debrid-flix/src/pages/MusicTaste.tsx
  • debrid-flix/src/pages/SongXray.tsx
  • debrid-flix/src/pages/Discover.tsx
  • debrid-flix/src/pages/Lineage.tsx
10 / FEATURE

YouTube channels, captions and inspiration

Manage channel subscriptions and categories, save videos, browse recommendations and inspect captions or inspiration collections.

HOW IT WORKS

Per-profile channel manager, topic/history state and caption/search pages are exposed through the React app and server integrations.

Implemented; recommendation and caption content depends on configured external services/data.

Implementation references
  • debrid-flix/src/pages/ChannelManager.tsx
  • debrid-flix/src/pages/YouTubeCaptions.tsx
  • debrid-flix/src/pages/Inspiration.tsx
  • debrid-flix/src/pages/Harmony.tsx
  • debrid-flix/README.md
11 / FEATURE

TV and remote navigation

Support keyboard and television remote movement across app surfaces and player controls, including a Samsung TV wrapper.

HOW IT WORKS

Shared focus/navigation and big-screen behavior in the web app, plus a Samsung app shell and build script; video paths account for older TV browser constraints.

Implemented; device-specific behavior needs target-device validation.

Implementation references
  • debrid-flix/src/nav.ts
  • debrid-flix/src/bigscreen.ts
  • debrid-flix/src/shortcuts.tsx
  • debrid-flix/tv/samsung/app.js
  • debrid-flix/tv/samsung/index.html
  • debrid-flix/tv/samsung/build.sh
04 / WORKING METHOD

Building and checking it.

A user selects a profile, browses a catalog, chooses a title, and the server selects a browser-compatible source and streams it through the local service. The player resumes from saved progress and can switch to a smaller or more compatible source after repeated stalls. Keyboard and TV remote navigation share app-level focus and playback actions.

Books and music use separate ingestion and playback flows but share profiles, home discovery, and persistent progress. Media-provider credentials and host topology are deployment configuration, not part of the public case study.

05 / STATUS & LIMITS

A personal-use integration dependent on external catalog and media services. Codec support and TV behavior vary by device; some playback paths require FFmpeg. The code does not establish rights to third-party media.

Source notes

Based on repository code and project records reviewed on October 30, 2026. Historical checks are described as recorded, not rerun for this article. Screenshots, renders, and mockups are labeled individually.

  • debrid-flix/README.md
  • debrid-flix/package.json
  • debrid-flix/src/pick.ts
  • debrid-flix/server/rangecache.ts
  • debrid-flix/server/remux.ts
  • debrid-flix/test/server.test.ts
  • debrid-flix/src/pick.test.ts
  • debrid-flix/server/rangecache.test.ts
← All projectsNEXT PROJECTWriter’s Room →