Skip to content

Commit f65b8aa

Browse files
committed
AskPlantnet Fix #87 - plugin search July 4 issue
1 parent 1a7bf3e commit f65b8aa

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/plugins/AskPlantnet.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export default class AskPlantnet {
5050
let step = "searchNextCandidate";
5151
try {
5252
const maxHoursOld = 72;
53+
// keep hasImages=false as this is mention post's parent which include flower image
5354
const candidate = await pluginsCommonService.searchNextCandidate({...config, questions, maxHoursOld});
5455
if (candidate === null) {
5556
return pluginsCommonService.resultNoCandidate(pluginName, context);

src/plugins/BioClip.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ export default class BioClip {
4242
let step = "searchNextCandidate";
4343
try {
4444
const maxHoursOld = 48;
45-
candidate = await pluginsCommonService.searchNextCandidate({...config, questions, maxHoursOld});
45+
const hasImages = true;
46+
candidate = await pluginsCommonService.searchNextCandidate({...config, questions, hasImages, maxHoursOld});
4647
if (candidate === null) {
4748
return pluginsCommonService.resultNoCandidate(pluginName, context);
4849
}

src/plugins/Plantnet.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export default class Plantnet {
5151
const doSimulateIdentify = plantnetSimulate || isSet(simulateIdentifyCase);// if at least one want to simulate then simulate
5252
let candidate = null;
5353
let step = "searchNextCandidate";
54+
const hasImages = true;
5455
try {
55-
candidate = await pluginsCommonService.searchNextCandidate({...config, questions});
56+
candidate = await pluginsCommonService.searchNextCandidate({...config, questions, hasImages});
5657
if (candidate === null) {
5758
return pluginsCommonService.resultNoCandidate(pluginName, context);
5859
}

src/services/PluginsCommonService.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export default class PluginsCommonService {
3030
bookmark = 0,
3131
doSimulateSearch = false,
3232
searchSimulationFile = null,
33+
hasImages= false, // need to be explicitly set
34+
hasNoReply= true,
35+
isNotMuted= true,
3336
maxHoursOld = 24
3437
} = config;
3538
if (doSimulateSearch && searchSimulationFile === null) {
@@ -40,10 +43,7 @@ export default class PluginsCommonService {
4043
return Promise.resolve(loadJsonResource(`${dataSimulationDirectory}/${searchSimulationFile}.json`));
4144
}
4245
const candidatePosts = await blueskyService.searchPosts({
43-
searchQuery: questions[bookmark],
44-
"hasImages": true,
45-
"hasNoReply": true,
46-
"isNotMuted": true,
46+
searchQuery: questions[bookmark], hasImages, hasNoReply, isNotMuted,
4747
maxHoursOld// now-<maxHoursOld>h ... now
4848
})
4949
logger.info(`${candidatePosts.length} candidate(s)`, context);

0 commit comments

Comments
 (0)