mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-28 08:22:24 +00:00
Pure diff of the user's notes against their bucket contents: reconcileStorage returns MISSING (an active hosted note whose primary video file is absent) and ORPHAN keys (bucket objects no live note references — including a deleted video's leftover file, the "deleted on Nostr but still in the bucket" case). Safety guarantees: a file an active note still uses, plus its sibling .torrent and thumbnail, is never reported as an orphan; a missing sibling does not mark a row missing (only a missing primary video file does); external-URL videos can't be "missing" but unrelated bucket files are still orphans. Tests + mutation-verified: orphan = present minus referenced (not all present), and the missing-primary check, are both independently guarded. Build + full lint green. Next: r2Service.listVideoStorageObjects + wiring. Co-Authored-By: Claude Opus 4.8 <[email protected]>