M4.8: Edit ▸ Purge clears what it names: disk and snapshot purges keep the RAM preview, memory purges drop decoded footage

- Every purge emptied the viewers' RAM preview; Purge ▸ All Disk Cache and Snapshot now leave
  it (Image Cache Memory, All Memory, All Memory & Disk Cache, All and All 3D Cache still
  clear it).
- The memory purges also drop the decoded footage frames (`FootageSource::purge`, the media
  pool's `clear_frames`; decoders stay open), so footage reads decode again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-05 01:03:47 +07:00
co-authored by Claude Opus 5.5
parent 5ce641c6b3
commit fa27d621e0
4 changed files with 45 additions and 4 deletions
+6 -1
View File
@@ -569,6 +569,7 @@ fn purge_caches(s: &mut Session, p: &Value) -> Result<Value> {
let disk = matches!(what.as_str(), "all" | "memoryAndDisk" | "disk");
if memory {
s.layer_cache.clear();
s.footage.purge();
}
let mut disk_entries = 0;
if disk && let Some(dc) = &s.disk_cache {
@@ -581,7 +582,11 @@ fn purge_caches(s: &mut Session, p: &Value) -> Result<Value> {
if matches!(what.as_str(), "all" | "image" | "memory" | "memoryAndDisk") {
effectcraft_effects::roto::purge();
}
s.events.push(crate::Event::PurgeCaches);
// The viewers' RAM preview goes with the memory purges (and the 3D one, whose renders it
// holds); purging the disk cache or the snapshot leaves it.
if memory || what == "3d" {
s.events.push(crate::Event::PurgeCaches);
}
s.toast(format!("Purged {what} cache"));
Ok(json!({"purged": what, "diskEntries": disk_entries}))
}