From 83f943c9f519468a921149d2d62c4aa631c907db Mon Sep 17 00:00:00 2001 From: Mattk70 Date: Tue, 30 Jan 2024 18:43:21 +0000 Subject: [PATCH] Added trim() to labels to remove \r line feed. Tsk! --- js/worker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/worker.js b/js/worker.js index ea7e76b0..a92e1b17 100644 --- a/js/worker.js +++ b/js/worker.js @@ -2807,13 +2807,13 @@ async function onUpdateLocale(labels){ if (STATE.model === 'v2.4'){ for (let i = 0; i < labels.length; i++){ const id = i; - const [sname, cname] = labels[i].split('_'); + const [sname, cname] = labels[i].trim().split('_'); await diskDB.runAsync('UPDATE species SET cname = ? WHERE id = ?', cname, id); await memoryDB.runAsync('UPDATE species SET cname = ? WHERE id = ?', cname, id); } } else { for (let i = 0; i < labels.length; i++) { - const [sname, common] = labels[i].split('_'); + const [sname, common] = labels[i].trim().split('_'); // Check if the existing cname ends with a word or words in brackets const existingCnameResult = await memoryDB.allAsync('SELECT id, cname FROM species WHERE sname = ?', sname); if (existingCnameResult.length) {