Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed Feb 13, 2023
1 parent e411ad0 commit c190296
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 16 deletions.
15 changes: 15 additions & 0 deletions .idea/git_toolbox_prj.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions spec/search/becca_mocking.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Note = require('../../src/becca/entities/bnote.js');
const Branch = require('../../src/becca/entities/bbranch.js');
const Attribute = require('../../src/becca/entities/battribute.js');
const Note = require('../../src/becca/entities/bnote');
const Branch = require('../../src/becca/entities/bbranch');
const Attribute = require('../../src/becca/entities/battribute');
const becca = require('../../src/becca/becca');
const randtoken = require('rand-token').generator({source: 'crypto'});

Expand Down
2 changes: 0 additions & 2 deletions spec/search/search.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const searchService = require('../../src/services/search/services/search');
const Note = require('../../src/becca/entities/bnote.js');
const Branch = require('../../src/becca/entities/bbranch.js');
const SearchContext = require('../../src/services/search/search_context');
const dateUtils = require('../../src/services/date_utils');
const becca = require('../../src/becca/becca');
Expand Down
2 changes: 1 addition & 1 deletion src-build/docs-website/build_docs_website.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require("fs-extra");
const utils = require("../../src/services/utils.js");
const utils = require("../../src/services/utils");
const html = require("html");

const SRC_DIR = './src-build/docs-website';
Expand Down
1 change: 0 additions & 1 deletion src/becca/becca.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const sql = require("../services/sql");
const NoteSet = require("../services/search/note_set");
const BNoteRevision = require("./entities/bnote_revision.js");

/**
* Becca is a backend cache of all notes, branches and attributes. There's a similar frontend cache Froca.
Expand Down
1 change: 0 additions & 1 deletion src/etapi/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const v = require("./validators");
const searchService = require("../services/search/services/search");
const SearchContext = require("../services/search/search_context");
const zipExportService = require("../services/export/zip");
const noteRevisionService = require("../services/note_revisions.js");

function register(router) {
eu.route(router, 'get', '/etapi/notes', (req, res, next) => {
Expand Down
4 changes: 2 additions & 2 deletions src/routes/api/sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const imageType = require('image-type');
const imageService = require('../../services/image');
const noteService = require('../../services/notes');
const {sanitizeAttributeName} = require("../../services/sanitize_attribute_name.js");
const specialNotesService = require("../../services/special_notes.js");
const {sanitizeAttributeName} = require("../../services/sanitize_attribute_name");
const specialNotesService = require("../../services/special_notes");

function uploadImage(req) {
const file = req.file;
Expand Down
2 changes: 1 addition & 1 deletion src/services/import/enex.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const noteService = require("../notes");
const imageService = require("../image");
const protectedSessionService = require('../protected_session');
const htmlSanitizer = require("../html_sanitizer");
const {sanitizeAttributeName} = require("../sanitize_attribute_name.js");
const {sanitizeAttributeName} = require("../sanitize_attribute_name");

/**
* date format is e.g. 20181121T193703Z or 2013-04-14T16:19:00.000Z (Mac evernote, see #3496)
Expand Down
4 changes: 2 additions & 2 deletions src/services/note_ancillaries.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const protectedSession = require("./protected_session.js");
const log = require("./log.js");
const protectedSession = require("./protected_session");
const log = require("./log");

/**
* @param {BNote} note
Expand Down
2 changes: 0 additions & 2 deletions src/services/text_extracting.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ async function ocrTextFromBuffer(buffer) {
}

async function runOcr(note, buffer) {
console.log("buffer length", buffer.length);

if (!note.isImage()
|| !optionService.getOptionBool('ocrImages')
|| cls.isOcrDisabled()
Expand Down
2 changes: 1 addition & 1 deletion src/services/user_guide_import.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async function importZip(fileBuffer, importRootNote) {
}

function getNoteId(noteMeta) {
let userGuideNoteId = noteMeta.attributes?.find(attr => attr.type === 'label' && attr.name === 'helpNoteId')?.value;
let userGuideNoteId;// = noteMeta.attributes?.find(attr => attr.type === 'label' && attr.name === 'helpNoteId')?.value;

userGuideNoteId = '_userGuide' + noteMeta.title.replace(/[^a-z0-9]/ig, '');

Expand Down

0 comments on commit c190296

Please sign in to comment.