fix(scan): allow slower SANE network discovery

This commit is contained in:
2026-09-24 17:09:35 +02:00
parent dde46f10e1
commit b9cfdbe29e
3 changed files with 23 additions and 4 deletions

View File

@@ -20,7 +20,9 @@ export const hasSane = () => commandExists("scanimage")
export const listScanners = async () => {
if (!await hasSane()) return []
const result = await runCommand("scanimage", ["-L"], { timeoutMs: 10_000 })
// SANE also probes network backends; these can take more than ten seconds
// even when the USB scanner is already available.
const result = await runCommand("scanimage", ["-L"], { timeoutMs: 30_000 })
if (result.code !== 0) return []
return result.stdout.split(/\r?\n/)
.map((line) => line.trim().match(/^device `([^']+)'/)?.[1])