From 1f3d73b9fd7fb91d7278d06a26b60e5f9734a1b9 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 22 Dec 2020 20:21:15 +0100 Subject: [PATCH 1/2] release 0.45.7 --- package.json | 2 +- src/services/build.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0a1278a17..bb729dc75 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "trilium", "productName": "Trilium Notes", "description": "Trilium Notes", - "version": "0.45.6", + "version": "0.45.7", "license": "AGPL-3.0-only", "main": "electron.js", "bin": { diff --git a/src/services/build.js b/src/services/build.js index dcbd5d8f5..18f8a65b8 100644 --- a/src/services/build.js +++ b/src/services/build.js @@ -1 +1 @@ -module.exports = { buildDate:"2020-12-04T22:08:24+01:00", buildRevision: "b7b1324dd0b2af6abc8cd5b98f620ca227582d4d" }; +module.exports = { buildDate:"2020-12-22T20:21:15+01:00", buildRevision: "bdfd760b9d428dc29c45a0e016d12a25af220043" }; From b0b2951ff62249721894252c8896989186c981f0 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 22 Dec 2020 22:30:04 +0100 Subject: [PATCH 2/2] cleanup --- src/routes/api/export.js | 4 ---- src/services/export/zip.js | 7 +++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/routes/api/export.js b/src/routes/api/export.js index a2877e3d2..de905d0cd 100644 --- a/src/routes/api/export.js +++ b/src/routes/api/export.js @@ -23,11 +23,7 @@ function exportBranch(req, res) { try { if (type === 'subtree' && (format === 'html' || format === 'markdown')) { - const start = Date.now(); - zipExportService.exportToZip(taskContext, branch, format, res); - - console.log("Export took", Date.now() - start, "ms"); } else if (type === 'single') { singleExportService.exportSingleNote(taskContext, branch, format, res); diff --git a/src/services/export/zip.js b/src/services/export/zip.js index 5346dbbee..5c7376f34 100644 --- a/src/services/export/zip.js +++ b/src/services/export/zip.js @@ -143,7 +143,7 @@ function exportToZip(taskContext, branch, format, res) { const available = !note.isProtected || protectedSessionService.isProtectedSessionAvailable(); // if it's a leaf then we'll export it even if it's empty - if (available && ((note.getContent()).length > 0 || childBranches.length === 0)) { + if (available && (note.getContent().length > 0 || childBranches.length === 0)) { meta.dataFileName = getDataFileName(note, baseFileName, existingFileNames); } @@ -433,14 +433,13 @@ ${content} } const note = branch.getNote(); - const zipFileName = (branch.prefix ? (branch.prefix + " - ") : "") + note.title + ".zip"; + const zipFileName = (branch.prefix ? `${branch.prefix} - ` : "") + note.title + ".zip"; res.setHeader('Content-Disposition', utils.getContentDisposition(zipFileName)); res.setHeader('Content-Type', 'application/zip'); - zipFile.end(); - zipFile.outputStream.pipe(res); + zipFile.end(); taskContext.taskSucceeded(); }