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.
This commit is contained in:
pax 2026-04-09 20:52:36 -05:00
parent acfcb88aca
commit 264c421dff

View File

@ -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()