From 264c421dffac2e599fd03da8d6358c5928928c75 Mon Sep 17 00:00:00 2001 From: pax Date: Thu, 9 Apr 2026 20:52:36 -0500 Subject: [PATCH] cache: skip .part files in evict_oldest Prevents cache eviction from deleting a .part temp file that mpv's stream-record is actively writing to. Prerequisite for the stream-record plumbing in video_player.py. --- booru_viewer/core/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/booru_viewer/core/cache.py b/booru_viewer/core/cache.py index 02489e6..eb23b86 100644 --- a/booru_viewer/core/cache.py +++ b/booru_viewer/core/cache.py @@ -506,7 +506,7 @@ def evict_oldest(max_bytes: int, protected_paths: set[str] | None = None) -> int for f in files: if current <= max_bytes: break - if not f.is_file() or str(f) in protected: + if not f.is_file() or str(f) in protected or f.suffix == ".part": continue size = f.stat().st_size f.unlink()