Story 6
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user