"""Where a video actually lives, and how to link into the middle of it. Every segment newsdesk stores has to answer one question: *press play at 1:08:27 — where?* Today the answer is a YouTube URL. It will not always be. The same episode may sit on disk, ripped or recorded; a show may take its uploads down; a video may only ever have existed as a local file. So nothing in this codebase stores a YouTube URL as a fact. It stores a `MediaRef` — a kind and a key — and asks this module for a link when it needs one. Swapping YouTube for a copy on disk is then a line of config rather than an UPDATE across every item that mentioned it. video: local_media: GUYEofBebDc: D:/media/lwiai/255.mp4 `resolve` applies that map. Everything downstream keeps working because it was never holding a URL in the first place. The one thing this deliberately does not do is *find* local copies. Matching "is this file the same episode as that video" by filename or duration is a guess, and a wrong guess points a citation at the wrong recording. The mapping is written by a person, or it does not exist. """ from __future__ import annotations from dataclasses import dataclass from pathlib import Path, PurePath #: A local file, playable in the reading pane's