A self-hosted media database that links your Plex library, watched history (Plex + Letterboxd + MyAnimeList), and a curated watchlist into one place — with TMDB-powered discovery, an acquisition helper wired to qBittorrent, and director/cast browsing.
  • Python 37.9%
  • JavaScript 33.7%
  • CSS 20%
  • HTML 7.9%
  • Shell 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-18 03:36:44 -07:00
static Fix media identity, sync, and SPA state bugs 2026-10-18 03:36:44 -07:00
templates Fix media identity, sync, and SPA state bugs 2026-10-18 03:36:44 -07:00
.gitignore Revamp visual design: occult repertory-cinema aesthetic 2026-05-31 01:21:24 -07:00
agent_mcp.py Fix media identity, sync, and SPA state bugs 2026-10-18 03:36:44 -07:00
AGENTS.md Fix media identity, sync, and SPA state bugs 2026-10-18 03:36:44 -07:00
app.py Fix media identity, sync, and SPA state bugs 2026-10-18 03:36:44 -07:00
backup.sh Elevate UI, move Continue Watching to Library, add roadmap + backup 2026-06-15 19:07:10 -07:00
CLAUDE.md Fix media identity, sync, and SPA state bugs 2026-10-18 03:36:44 -07:00
README.md Fix media identity, sync, and SPA state bugs 2026-10-18 03:36:44 -07:00
ROADMAP.md Fix media identity, sync, and SPA state bugs 2026-10-18 03:36:44 -07:00
run.sh Add run.sh launcher script 2026-05-29 04:12:37 -07:00

🌙 MediaVault

A self-hosted media database that links your Plex library, watched history (Plex + Letterboxd + MyAnimeList), and a curated watchlist into one place — with TMDB-powered discovery, an acquisition helper wired to qBittorrent, and director/cast browsing.

Features

  • Library — browse your full Plex library with rich filters (genre, decade, runtime, rating) and sorting; posters proxied straight from Plex.
  • Tonight — "what should I watch?" picker with mood presets (quick watch, long evening, horror, hidden gem, retro) over your unwatched films, plus advanced filters (genre, decade, runtime, rating, title, include-watched).
  • Discover — curated watchlist + TMDB recommendations seeded from your 5★ Letterboxd films, "deep cuts" mode, and hidden gems. Find Similar takes any movie/show title and returns similar titles ranked by a content-match score (genre overlap, rating, vote confidence, year proximity), cross-referenced against your library.
  • Acquire — watchlist items not yet in Plex, priority-scored, with in-app qBittorrent search and one-click "Send to qBit".
  • Insights — genre/decade breakdowns, watch-time totals, Letterboxd rating distribution, hidden gems and recently-added rails.
  • ✦ Ask — chat assistant with tool access to your library, watchlist, and TMDB similar-title search ("what should I watch tonight?", "find films like X", "add Y to my watchlist"). Providers (Settings → Assistant): Claude via your Pro/Max subscription (default — runs your own logged-in claude CLI, no metered tokens; Haiku by default), Claude via API key, or Kimi.
  • Person pages — click any director/writer/actor to see their full filmography cross-referenced against your library, watchlist, and watched history.
  • Trailers & More like this in every item modal.
  • External links — IMDb, TMDB, Letterboxd (films), MyAnimeList (anime).

Setup

pip install flask requests
python3 app.py

Then open http://127.0.0.1:7331 and configure under Settings:

  • Plex token — required to sync your library. Sync → Libraries to sync picks which Plex movie/TV libraries are pulled in (default: all of them).
  • TMDB API key — free at themoviedb.org; enables posters, recommendations, trailers, credits.
  • qBittorrent — Web UI URL / username / password for the Acquire tab.

Watched-history imports (optional)

Drop export files in ~/.local/share/plex-watched/:

  • movies.txt, tv_shows.txt — Title (Year) per line
  • letterboxd.txt — ★★★★ | Title (Year) per line
  • mal.txt — 8/10 | Title [...] per line
  • curated_watchlist.md — ## Category headers, **Title (Year)** — reason

Then hit Sync Now in Settings. Working Plex access is required; a failed Plex refresh preserves the cache and aborts imports.

Sync and matching

  • Plex refreshes are transactional and paginate even when an individual metadata record is skipped. Completed TV series use Plex's aggregate episode counts.
  • Watchlist/library matching respects movie/TV namespaces, known IDs, and remake years. Valid Plex associations are preserved instead of reassigned by title.
  • Curated imports enrich an existing matching entry without duplicating it or resetting its status, rating, notes, or original source.
  • A successful sync refreshes cached views on the active/next tab visit while retaining search, sort, and filter preferences. Person-view Back restores working title actions, trailers, and episode controls.
  • qBittorrent search failures are reported rather than presented as no matches; temporary search jobs are stopped and deleted.

Remote access (Tailscale / LAN)

By default the app binds to loopback only. To reach it remotely:

  1. Settings → Network → set bind host to 0.0.0.0
  2. Add your hostname/IP to allowed Host headers (e.g. your tailnet name)
  3. Set an auth token (required for any non-loopback request)
  4. Restart, then visit http://your-host:7331/?auth=<token>

Loopback requests always skip auth. Non-loopback requests must send the token via X-Auth-Token header or ?auth= query param. A browser that opens the ?auth= link gets an HttpOnly cookie and is redirected to the same page without the token, so later visits need no token in the URL.

Security notes

  • media.db holds all secrets (Plex/TMDB/qBit/auth) and is gitignored.
  • Host-header validation blocks DNS-rebinding attacks.
  • Non-GET requests from another origin (a hostile web page POSTing to 127.0.0.1) are rejected.
  • rating_key inputs are validated to digits to prevent SSRF via the thumb proxy.

Stack

Flask + SQLite backend, vanilla-JS SPA frontend. No build step. Five themes (witchy default, trans pride, dracula, solarized dark/light), each a pure CSS-variable palette swap.

The ✦ button in the header toggles atmospheric effects (film grain, glows, backdrop blurs, entrance animations). Turn it off on low-power or compositing-sensitive displays — the palette and layout stay intact, only the continuous-repaint effects drop. The choice is remembered, and reduced effects are the default for anyone whose OS requests reduced motion.