You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-09-16 08:56:40 +02:00
Clean up and comment
This commit is contained in:
@@ -26,10 +26,6 @@ class FileApiDriverLocal {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
supportsDelta() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
stat(path) {
|
stat(path) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
fs.stat(path, (error, s) => {
|
fs.stat(path, (error, s) => {
|
||||||
|
@@ -7,10 +7,6 @@ class FileApiDriverMemory {
|
|||||||
this.deletedItems_ = [];
|
this.deletedItems_ = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
supportsDelta() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
itemIndexByPath(path) {
|
itemIndexByPath(path) {
|
||||||
for (let i = 0; i < this.items_.length; i++) {
|
for (let i = 0; i < this.items_.length; i++) {
|
||||||
if (this.items_[i].path == path) return i;
|
if (this.items_[i].path == path) return i;
|
||||||
|
@@ -14,10 +14,6 @@ class FileApiDriverOneDrive {
|
|||||||
return this.api_;
|
return this.api_;
|
||||||
}
|
}
|
||||||
|
|
||||||
supportsDelta() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
itemFilter_() {
|
itemFilter_() {
|
||||||
return {
|
return {
|
||||||
select: 'name,file,folder,fileSystemInfo,parentReference',
|
select: 'name,file,folder,fileSystemInfo,parentReference',
|
||||||
|
@@ -23,10 +23,6 @@ class FileApi {
|
|||||||
return this.syncTargetId_;
|
return this.syncTargetId_;
|
||||||
}
|
}
|
||||||
|
|
||||||
supportsDelta() {
|
|
||||||
return this.driver_.supportsDelta();
|
|
||||||
}
|
|
||||||
|
|
||||||
setLogger(l) {
|
setLogger(l) {
|
||||||
this.logger_ = l;
|
this.logger_ = l;
|
||||||
}
|
}
|
||||||
|
@@ -358,14 +358,14 @@ class Synchronizer {
|
|||||||
while (true) {
|
while (true) {
|
||||||
if (this.cancelling()) break;
|
if (this.cancelling()) break;
|
||||||
|
|
||||||
// let allIds = null;
|
|
||||||
// if (!this.api().supportsDelta()) {
|
|
||||||
// allIds = await BaseItem.syncedItemIds(syncTargetId);
|
|
||||||
// }
|
|
||||||
|
|
||||||
let listResult = await this.api().delta('', {
|
let listResult = await this.api().delta('', {
|
||||||
context: context,
|
context: context,
|
||||||
// itemIds: allIds,
|
|
||||||
|
// allItemIdsHandler() provides a way for drivers that don't have a delta API to
|
||||||
|
// still provide delta functionality by comparing the items they have to the items
|
||||||
|
// the client has. Very inefficient but that's the only possible workaround.
|
||||||
|
// It's a function so that it is only called if the driver needs these IDs. For
|
||||||
|
// drivers with a delta functionality it's a noop.
|
||||||
allItemIdsHandler: async () => { return BaseItem.syncedItemIds(syncTargetId); }
|
allItemIdsHandler: async () => { return BaseItem.syncedItemIds(syncTargetId); }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user