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:
parent
acfcb88aca
commit
264c421dff
@ -506,7 +506,7 @@ def evict_oldest(max_bytes: int, protected_paths: set[str] | None = None) -> int
|
|||||||
for f in files:
|
for f in files:
|
||||||
if current <= max_bytes:
|
if current <= max_bytes:
|
||||||
break
|
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
|
continue
|
||||||
size = f.stat().st_size
|
size = f.stat().st_size
|
||||||
f.unlink()
|
f.unlink()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user