This commit is contained in:
Ryan Shpeherd
2026-08-10 17:09:08 -04:00
parent ac8fc5ed7c
commit 0d6b5b9b9d
6 changed files with 429 additions and 4 deletions
+8 -1
View File
@@ -23,11 +23,18 @@ class ScratchManager:
return self.frame_dir
def cleanup(self) -> None:
"""Remove the video-specific frame directory and everything underneath it."""
"""Remove the frame scratch directory only."""
if self.auto_cleanup and self.frame_dir.exists():
shutil.rmtree(self.frame_dir)
logger.info("Cleaned scratch frames for %s", self.video_id)
def cleanup_all(self) -> None:
"""Remove the entire per-video scratch directory (frames + crops)."""
video_root = self.base_path / self.video_id
if self.auto_cleanup and video_root.exists():
shutil.rmtree(video_root)
logger.info("Cleaned all scratch data for %s", self.video_id)
def usage_bytes(self) -> int:
"""Return the total size of the scratch directory in bytes."""
if not self.frame_dir.exists():