Skip to content

Build your personal knowledge base with Trilium Notes

fix: remove duplication

soulsands50043f889bf5
diff --git a/src/becca/similarity.js b/src/becca/similarity.js
index dadfb1ce57..2e77501001 100644
--- a/src/becca/similarity.js
+++ b/src/becca/similarity.js
@@ -2,7 +2,7 @@ const becca = require('./becca');
const log = require('../services/log');
const beccaService = require('./becca_service');
const dateUtils = require('../services/date_utils');
-const { JSDOM } = require("jsdom");
+const {JSDOM} = require("jsdom");
const DEBUG = false;
@@ -168,7 +168,6 @@ function trimMime(mime) {
}
mimeCache[mime] = str;
- mimeCache[mime] = str;
}
return mimeCache[mime];
@@ -224,8 +223,8 @@ function splitToWords(text) {
*/
function hasConnectingRelation(sourceNote, targetNote) {
return sourceNote.getAttributes().find(attr => attr.type === 'relation'
- && ['includenotelink', 'imagelink'].includes(attr.name)
- && attr.value === targetNote.noteId);
+ && ['includenotelink', 'imagelink'].includes(attr.name)
+ && attr.value === targetNote.noteId);
}
async function findSimilarNotes(noteId) {
@@ -301,7 +300,7 @@ async function findSimilarNotes(noteId) {
for (const branch of parentNote.getParentBranches()) {
score += gatherRewards(branch.prefix, 0.3)
- + gatherAncestorRewards(branch.parentNote);
+ + gatherAncestorRewards(branch.parentNote);
}
}
}
@@ -314,7 +313,7 @@ async function findSimilarNotes(noteId) {
function computeScore(candidateNote) {
let score = gatherRewards(trimMime(candidateNote.mime))
- + gatherAncestorRewards(candidateNote);
+ + gatherAncestorRewards(candidateNote);
if (candidateNote.isDecrypted) {
score += gatherRewards(candidateNote.title);
@@ -382,7 +381,7 @@ async function findSimilarNotes(noteId) {
score += 1;
}
else if (utcDateCreated.substr(0, 10) === dateLimits.minDate.substr(0, 10)
- || utcDateCreated.substr(0, 10) === dateLimits.maxDate.substr(0, 10)) {
+ || utcDateCreated.substr(0, 10) === dateLimits.maxDate.substr(0, 10)) {
if (displayRewards) {
console.log("Adding reward for same day of creation");
}