From 41b7b29d8c059b5bc2925798887f0e4eedd49ad1 Mon Sep 17 00:00:00 2001 From: Simon Hofmann Date: Tue, 12 Dec 2023 20:22:02 +0100 Subject: [PATCH] Bugfix/(nut tree/plugin ocr#25)/default confidence (#544) * (nut-tree/plugin-ocr#25) Made the confidence value of a match request optional * (nut-tree/plugin-ocr#25) Stop setting a default confidence value to not override other confidence value (e.g. the OCR one) with the explicit value of the match request * (nut-tree/plugin-ocr#25) Removed redefinition of sleep and used import * (nut-tree/plugin-ocr#25) Updated workflow definitions * (nut-tree/plugin-ocr#25) Run npx playwright install before running tests * (nut-tree/plugin-ocr#25) Specify working directory where to load the Electron main from in window tests * (nut-tree/plugin-ocr#25) Increased Jest timeout for window tests to accommodate startup times, removed superfluous Docker stuf from CI runs on macOS and Windows, since tests would be running in Linux again which is just confusing in this place * (nut-tree/plugin-ocr#25) Formatting --- lib/match-request.class.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/match-request.class.ts b/lib/match-request.class.ts index 03d91bf..94e36ad 100644 --- a/lib/match-request.class.ts +++ b/lib/match-request.class.ts @@ -80,7 +80,9 @@ export function createMatchRequest( .info( `Searching for image ${ needle.id - } in region ${searchRegion.toString()}. Required confidence: ${minMatch}`, + } in region ${searchRegion.toString()}.${ + minMatch != null ? ` Required confidence: ${minMatch}` : "" + }`, ); return new MatchRequest( @@ -93,7 +95,11 @@ export function createMatchRequest( providerRegistry.getLogProvider().info( `Searching for ${isLineQuery(needle) ? "line" : "word"} { ${isLineQuery(needle) ? needle.by.line : needle.by.word} - } in region ${searchRegion.toString()}. Required confidence: ${minMatch}`, + } in region ${searchRegion.toString()}.${ + minMatch != null + ? ` Required confidence: ${minMatch}` + : "" + }`, ); return new MatchRequest(