added progress also to export

This commit is contained in:
zadam
2019-02-10 22:30:55 +01:00
parent a097cefba7
commit 6be8a3f343
14 changed files with 147 additions and 35 deletions

View File

@@ -3,7 +3,7 @@
const repository = require("../repository");
const utils = require('../utils');
async function exportToOpml(branch, res) {
async function exportToOpml(exportContext, branch, res) {
const note = await branch.getNote();
async function exportNoteInner(branchId) {
@@ -21,6 +21,8 @@ async function exportToOpml(branch, res) {
res.write(`<outline title="${preparedTitle}" text="${preparedContent}">\n`);
exportContext.increaseProgressCount();
for (const child of await note.getChildBranches()) {
await exportNoteInner(child.branchId);
}
@@ -45,6 +47,8 @@ async function exportToOpml(branch, res) {
res.write(`</body>
</opml>`);
res.end();
exportContext.exportFinished();
}
function prepareText(text) {