#1830: require exporter support before skipping duplicate frames

This commit is contained in:
Kristian Myram
2026-10-30 08:59:53 +01:00
parent 37561799f6
commit c5671f6569
7 changed files with 39 additions and 4 deletions
+2 -1
View File
@@ -494,7 +494,8 @@ impl Session {
} else {
Target::file(Path::new(path), by_identity)
};
Write { item: m.id, path: path.to_string(), target, skips: m.settings.skip_existing }
let skips = m.settings.skip_existing && self.exporter.as_ref().is_some_and(|exporter| exporter.supports_skip_existing());
Write { item: m.id, path: path.to_string(), target, skips }
}
/// The report of `later` writing over `clash`.
+5
View File
@@ -57,6 +57,11 @@ pub struct ExportResult {
pub trait Exporter: Send + Sync {
/// Formats this build can write.
fn formats(&self) -> Vec<OutputFormat>;
/// Whether Skip Existing Files preserves sequence frames written by earlier items. Exporters
/// without an existence check (such as memory sinks) must keep the conservative default.
fn supports_skip_existing(&self) -> bool {
false
}
/// Render and write one item (blocking). `progress(done, total)` returns `false` to cancel;
/// a cancelled export removes the files it opened for that output and returns `Err("cancelled")`.
/// Completed earlier queue items and unrelated files must be preserved.
@@ -28,6 +28,9 @@ impl Exporter for Writer {
fn formats(&self) -> Vec<OutputFormat> {
OutputFormat::ALL.to_vec()
}
fn supports_skip_existing(&self) -> bool {
true
}
fn export(&self, job: &ExportJob, _: &mut dyn FnMut(u64, u64) -> bool) -> Result<ExportResult, String> {
self.jobs.lock().unwrap().push(job.path.to_string());
let comp = job.project.comp(job.item.comp).ok_or("no comp")?;