MediaShelf/.env.example
Jess Hallsworth 1ba03dca70
Generalise protected libraries into keep marks
Watch data cannot tell you what is valuable, only what is unwatched. Some
content is held deliberately - home video, 4K copies that are expensive to
re-acquire, shows kept in case someone wants them later - and that judgement
has to be stated by a human and be un-overridable by the score.

One 'keep' concept, applied at four levels: library (a rule, so future
additions inherit it), show, season, movie. Explicit marks below the library
can point either way, so 'keep all of 4K Movies except this one' is
expressible rather than a dead end.

The important detail is identity. Plex reassigns ratingKeys on library
rebuilds and rematches, so marks are keyed on content guid instead -
(library_id, guid) for movies and shows, (library_id, show_guid,
season_number) for seasons. A keep list that silently detaches from its
content would, in v2, mean deleting something explicitly protected. That is
now the single most important test in the suite. Marks are scoped per
library on purpose: Movies and 4K Movies share guids, so an unscoped mark
would protect both copies at once.

Also: kept items hidden from the grid by default with a toggle; a Kept
items screen that surfaces orphaned marks rather than carrying them
silently; the dashboard always shows never-played / kept / available as
three numbers so a growing keep list cannot quietly hollow out the report;
nightly export of keeps and views to JSON, since they are the only data in
the database not reconstructible from Plex and Tautulli; and v2 deletion
refuses kept items ahead of every other guardrail.

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

49 lines
1.3 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 kept wholesale, seeded on first run only (comma-separated).
# Editable in the UI afterwards; this value is not re-applied on later starts.
KEEP_ALL_LIBRARIES=Family Videos
SCORE_RECENT_DAYS=90