Skip to content

Commit

Permalink
fix to db2ResultSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattk70 committed Mar 2, 2024
1 parent eb9dde6 commit 1094c28
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -2369,7 +2369,7 @@ function onChartData(args) {
}
},
KeyD: function (e) {
if (( e.ctrlKey || e.metaKey) && e.shiftKey) worker.postMessage({ action: 'convert-dataset' });
if (( e.ctrlKey || e.metaKey) && e.shiftKey) worker.postMessage({ action: 'create-dataset' });
},
KeyE: function (e) {
if (( e.ctrlKey || e.metaKey) && region) exportAudio();
Expand Down
22 changes: 12 additions & 10 deletions js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ let TEMP, appPath, BATCH_SIZE, LABELS, BACKEND, batchChunksToSend = {};
let LIST_WORKER;
const DEBUG = false;

const DATASET = false;
const DATASET = true;
const adding_chirpity_additions = false;
const dataset_database = DATASET;
const DATASET_SAVE_LOCATION = "E:/DATASETS/BirdNET_pngs";
const DATASET_SAVE_LOCATION = "E:/DATASETS/NEW_MODEL_PNGs";

// Adapted from https://stackoverflow.com/questions/6117814/get-week-of-year-in-javascript-like-in-php
Date.prototype.getWeekNumber = function(){
Expand Down Expand Up @@ -1474,9 +1474,11 @@ const prepSummaryStatement = (included) => {
JOIN species
ON species.id = records.speciesID
JOIN files ON records.fileID = files.id
${filtersApplied(included) ? `WHERE speciesID IN (${prepParams(STATE.included)}` : ''})
AND confidence >= ${STATE.detect.confidence}`;
let params = filtersApplied(included) ? STATE.included : [];
WHERE confidence >= ${STATE.detect.confidence}`;

db2ResultSQL+= filtersApplied(included) ? ` AND speciesID IN (${prepParams(STATE.included)})` : '';

let params = filtersApplied(included) ? included : [];
if (species) {
db2ResultSQL += ` AND species.cname = ?`;
params.push(species)
Expand Down Expand Up @@ -1746,11 +1748,11 @@ const prepSummaryStatement = (included) => {
await parseMessage(message).catch( (error) => {
console.warn("Parse message error", error, 'message was', message);
});
// Dial down the getSummary calls if the queue length starts growing
// if (messageQueue.length > NUM_WORKERS * 2 ) {
// STATE.incrementor = Math.min(STATE.incrementor *= 2, 256);
// console.log('increased incrementor to ', STATE.incrementor)
// }
//Dial down the getSummary calls if the queue length starts growing
if (messageQueue.length > NUM_WORKERS * 2 ) {
STATE.incrementor = Math.min(STATE.incrementor *= 2, 256);
console.log('increased incrementor to ', STATE.incrementor)
}


// Set isParsing to false to allow the next message to be processed
Expand Down

0 comments on commit 1094c28

Please sign in to comment.