fix(linux): distinguish test capture jobs from printed jobs
Some checks failed
Desktop Release / Bootstrap updater signing key (push) Has been cancelled
Desktop Release / Windows x64 NSIS (push) Has been cancelled
Desktop Release / Linux x64 DEB + AppImage (push) Has been cancelled
Desktop Release / Publish public desktop release (push) Has been cancelled
Some checks failed
Desktop Release / Bootstrap updater signing key (push) Has been cancelled
Desktop Release / Windows x64 NSIS (push) Has been cancelled
Desktop Release / Linux x64 DEB + AppImage (push) Has been cancelled
Desktop Release / Publish public desktop release (push) Has been cancelled
This commit is contained in:
parent
cc9031fcfd
commit
8d00d298df
@ -326,15 +326,16 @@ fn spool_folder_loop(
|
||||
|
||||
match fs::read(&path) {
|
||||
Ok(bytes) => {
|
||||
let is_test_capture = already_forwarded && label.starts_with("test-");
|
||||
let (forwarded, error) = if already_forwarded {
|
||||
(true, None)
|
||||
(!is_test_capture, None)
|
||||
} else {
|
||||
forward_payload(&config, &bytes)
|
||||
};
|
||||
process_payload(
|
||||
&state,
|
||||
&app,
|
||||
source,
|
||||
if is_test_capture { "cups-test" } else { source },
|
||||
label.clone(),
|
||||
bytes,
|
||||
forwarded,
|
||||
|
||||
@ -36,6 +36,7 @@ def safe(value):
|
||||
|
||||
job_id = safe(sys.argv[1] if len(sys.argv) > 1 else "job")
|
||||
title = safe(sys.argv[3] if len(sys.argv) > 3 else "print")
|
||||
printer = safe(os.environ.get("PRINTER", "printer"))
|
||||
content_type = os.environ.get("CONTENT_TYPE", "application/pdf")
|
||||
ext = {
|
||||
"application/pdf": "pdf",
|
||||
@ -43,7 +44,8 @@ ext = {
|
||||
"image/png": "png",
|
||||
"image/jpeg": "jpg",
|
||||
}.get(content_type, "dat")
|
||||
name = f"{job_id}-{title}-{uuid.uuid4().hex}.{ext}"
|
||||
prefix = "test-" if printer.lower() == "fieldlens-test-capture" else "print-"
|
||||
name = f"{prefix}{printer}-{job_id}-{title}-{uuid.uuid4().hex}.{ext}"
|
||||
final_path = os.path.join(SPOOL, name)
|
||||
part_path = final_path + ".part"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user