Download missing attachments as needed even in at-sync-time mode
This commit is contained in:
parent
3a2f0e6929
commit
9202ab8b3c
|
@ -4123,8 +4123,7 @@ var ZoteroPane = new function()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!item.isImportedAttachment()
|
if (!item.isImportedAttachment()
|
||||||
|| (!Zotero.Sync.Storage.Local.getEnabledForLibrary(item.libraryID)
|
|| !Zotero.Sync.Storage.Local.getEnabledForLibrary(item.libraryID)) {
|
||||||
|| !Zotero.Sync.Storage.Local.downloadAsNeeded(item.libraryID))) {
|
|
||||||
this.showAttachmentNotFoundDialog(itemID, noLocateOnMissing);
|
this.showAttachmentNotFoundDialog(itemID, noLocateOnMissing);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,8 +177,10 @@ describe("ZoteroPane", function() {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should download an attachment on-demand", function* () {
|
it("should download an attachment on-demand", function* () {
|
||||||
|
for (let fn of ['downloadAsNeeded', 'downloadOnSync']) {
|
||||||
yield setup();
|
yield setup();
|
||||||
Zotero.Sync.Storage.Local.downloadAsNeeded(Zotero.Libraries.userLibraryID, true);
|
|
||||||
|
Zotero.Sync.Storage.Local[fn](Zotero.Libraries.userLibraryID, true);
|
||||||
|
|
||||||
var item = new Zotero.Item("attachment");
|
var item = new Zotero.Item("attachment");
|
||||||
item.attachmentLinkMode = 'imported_file';
|
item.attachmentLinkMode = 'imported_file';
|
||||||
|
@ -227,6 +229,7 @@ describe("ZoteroPane", function() {
|
||||||
assert.equal((yield item.attachmentModificationTime), mtime);
|
assert.equal((yield item.attachmentModificationTime), mtime);
|
||||||
var path = yield item.getFilePathAsync();
|
var path = yield item.getFilePathAsync();
|
||||||
assert.equal((yield Zotero.File.getContentsAsync(path)), text);
|
assert.equal((yield Zotero.File.getContentsAsync(path)), text);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user