MediaShelf/.env.example
Jess Hallsworth 5e57fd1614
Validate the design against the live servers, and correct it
Ran the probe and a new reclaim preview against Loki and Tautulli from a LAN
host. The measured library is 65.7 TB across 24 libraries with 60 users and
87,640 logged plays. Five things in the design were wrong or missing.

- Tautulli's get_library_media_info returns file_size 0 for every show
  section regardless of section_type, so it cannot cross-check TV sizes.
  Plex is the only size authority for TV, which is 49 of the 66 TB.
- solitude: divisor of 3 confirmed correct (61.7% of watched items have
  exactly one viewer), but weight raised 0.04 -> 0.10 since on a 60-user
  server "only one person watched this" is real signal.
- rejection: abandonment is 4.9% of plays, not the 30% hoped for. Weight
  cut 0.12 -> 0.06. Kept because it is decisive when it fires.
- Cross-library duplicates promoted from "later candidate" to v1: with 16
  movie sections, Movies and 4K Movies routinely hold the same film.
- Protected libraries added. Family Videos is 38 GB of irreplaceable home
  video that is 86% "never played" and scores as a perfect delete target.

Also splits the reclaim pool into confident (6.5 TB, added while Tautulli
was watching and never played) and uncertain (20.9 TB, predates coverage).
80% of the library predates Tautulli, so pre_history is the majority state,
not an edge case.

Adds tools/reclaim_preview.py, which produced these numbers.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GVbG48GAXfCZatcmX123Ra
2026-09-07 05:23:34 +00:00

48 lines
1.2 KiB
Text

# MediaShelf configuration — copy to .env and fill in.
# NEVER commit .env. PLEX_TOKEN is a secret.
MEDIASHELF_SECRET_KEY=change-me
LOG_LEVEL=INFO
TZ=America/Regina
# --- Plex connection ---
PLEX_BASE_URL=http://192.168.1.10:32400
PLEX_TOKEN=your-plex-token-here
PLEX_VERIFY_SSL=true
PLEX_TIMEOUT_S=30
PLEX_PAGE_SIZE=500
PLEX_REQUEST_DELAY_MS=0
# --- Tautulli (primary watch-history source) ---
# Leave TAUTULLI_BASE_URL empty to disable and fall back to Plex session history.
TAUTULLI_BASE_URL=http://192.168.1.100:8181
TAUTULLI_API_KEY=your-tautulli-api-key-here
TAUTULLI_TIMEOUT_S=30
TAUTULLI_PAGE_SIZE=1000
# auto | tautulli | plex
HISTORY_SOURCE=auto
SESSION_MERGE_WINDOW_H=6
COMPLETION_THRESHOLD=85
ABANDON_CEILING=15
# --- Storage ---
DATABASE_PATH=/data/mediashelf.db
# --- Scanning ---
SCAN_SCHEDULE_CRON=0 4 * * *
SCAN_FULL_SWEEP_CRON=0 3 * * 0
SCAN_ON_STARTUP=false
SCAN_LOCK_TIMEOUT_S=7200
# --- Reclaim score tuning ---
SCORE_STALE_HORIZON_DAYS=730
SCORE_AGE_HORIZON_DAYS=1095
SCORE_POPULAR_AT=3
SCORE_REJECTED_AT=2
SCORE_SOLITUDE_AT=3
SCORE_GRACE_DAYS=30
# Libraries that must never be scored as deletion candidates (comma-separated).
PROTECTED_LIBRARIES=Family Videos
SCORE_RECENT_DAYS=90