1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Merge branch 'master' of github.com:laurent22/joplin

This commit is contained in:
Laurent Cozic 2017-10-26 22:57:56 +01:00
commit 5b140544e0
4 changed files with 13 additions and 10 deletions

View File

@ -1,6 +1,6 @@
{
"name": "joplin",
"version": "0.10.55",
"version": "0.10.57",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -18,7 +18,7 @@
],
"owner": "Laurent Cozic"
},
"version": "0.10.55",
"version": "0.10.57",
"bin": {
"joplin": "./main.js"
},

View File

@ -79,6 +79,8 @@ class FileApiDriverLocal {
}
async delta(path, options) {
const itemIds = await options.allItemIdsHandler();
try {
let items = await fs.readdir(path);
let output = [];
@ -89,11 +91,11 @@ class FileApiDriverLocal {
output.push(stat);
}
if (!Array.isArray(options.itemIds)) throw new Error('Delta API not supported - local IDs must be provided');
if (!Array.isArray(itemIds)) throw new Error('Delta API not supported - local IDs must be provided');
let deletedItems = [];
for (let i = 0; i < options.itemIds.length; i++) {
const itemId = options.itemIds[i];
for (let i = 0; i < itemIds.length; i++) {
const itemId = itemIds[i];
let found = false;
for (let j = 0; j < output.length; j++) {
const item = output[j];

View File

@ -358,14 +358,15 @@ class Synchronizer {
while (true) {
if (this.cancelling()) break;
let allIds = null;
if (!this.api().supportsDelta()) {
allIds = await BaseItem.syncedItemIds(syncTargetId);
}
// let allIds = null;
// if (!this.api().supportsDelta()) {
// allIds = await BaseItem.syncedItemIds(syncTargetId);
// }
let listResult = await this.api().delta('', {
context: context,
itemIds: allIds,
// itemIds: allIds,
allItemIdsHandler: async () => { return BaseItem.syncedItemIds(syncTargetId); }
});
let remotes = listResult.items;