#!/usr/bin/env python3 r"""Plan a Jellyfin-format relayout of a movie library. DRY RUN ONLY: nothing moves. media-plan.py [--root DIR] [--enum TSV] [--probed TSV] [--plex TSV] [--out TSV] [--exceptions TXT] Inputs are the TSVs scripts/media-census.py exports, plus the optional Plex metadata-cache export whose clean titles outrank the filename parser; the title authority for everything Plex never matched is scripts/media-titles.py beside this file. No media file is opened, so planning the whole library costs seconds. PLAN is a TSV the executor (scripts/media-apply.py) replays verbatim — `actionsrcdstkind` with action in mkdir | move | keep, ordered so parents exist before children. EXCEPTIONS is the human review list: every file the plan could not name a film for, every collision it refused, the READMEs the executor must write into the piles it created. Target contract (jellyfin.org/docs/general/server/media/movies): * one folder per movie, named Title (year) * the video inside is named exactly like the folder * extra copies of one film are versions: " -