2 months ago
a09a3f0#206: Song import copied media straight to the final content-addressed path guarded only by existence, so a crash/ENOSPC/cancel mid-copy left a truncated file that a later re-import silently accepted as complete. Route both the primary media copy and the Media+G copy_if_missing path through a new import_media_file: trust an existing destination only when its size matches the source, otherwise copy to a uniquely named sibling temp file, fsync, and atomically rename into place, cleaning up the temp on any error. This mirrors StreamingOggWriter and the model download promotion. #207: Downgrade disk-savings figures summed only the deleted drums+bass+ other bytes and ignored the accompaniment.ogg written in their place, over-reporting by roughly one stem. downgrade_to_two_stem now returns the deleted bytes minus the actual accompaniment size; estimate_downgrade_savings nets out the existing vocals stem as a same-encoding proxy. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Parent6ecbdfa