Skip to content

Commit 41b7b29

Browse files
authored
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
1 parent 820a0b9 commit 41b7b29

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/match-request.class.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ export function createMatchRequest<PROVIDER_DATA_TYPE>(
8080
.info(
8181
`Searching for image ${
8282
needle.id
83-
} in region ${searchRegion.toString()}. Required confidence: ${minMatch}`,
83+
} in region ${searchRegion.toString()}.${
84+
minMatch != null ? ` Required confidence: ${minMatch}` : ""
85+
}`,
8486
);
8587

8688
return new MatchRequest(
@@ -93,7 +95,11 @@ export function createMatchRequest<PROVIDER_DATA_TYPE>(
9395
providerRegistry.getLogProvider().info(
9496
`Searching for ${isLineQuery(needle) ? "line" : "word"} {
9597
${isLineQuery(needle) ? needle.by.line : needle.by.word}
96-
} in region ${searchRegion.toString()}. Required confidence: ${minMatch}`,
98+
} in region ${searchRegion.toString()}.${
99+
minMatch != null
100+
? ` Required confidence: ${minMatch}`
101+
: ""
102+
}`,
97103
);
98104

99105
return new MatchRequest(

0 commit comments

Comments
 (0)