mirror of
https://github.com/zotero/zotero.git
synced 2026-10-03 02:21:49 +00:00
Fix folder import
This commit is contained in:
parent
f18ce9eb1f
commit
3847047471
2 changed files with 3 additions and 5 deletions
|
|
@ -452,7 +452,7 @@ var Zotero_File_Interface = new function () {
|
|||
translation.relinkOnly = options.relinkOnly;
|
||||
}
|
||||
else if (options.folder) {
|
||||
Cu.import("chrome://zotero/content/import/folderImport.js");
|
||||
const { Zotero_Import_Folder } = ChromeUtils.importESModule("chrome://zotero/content/import/folderImport.js");
|
||||
translation = new Zotero_Import_Folder({
|
||||
folder: options.folder,
|
||||
recreateStructure: options.recreateStructure,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
var EXPORTED_SYMBOLS = ["Zotero_Import_Folder"]; // eslint-disable-line no-unused-vars
|
||||
|
||||
Services.scriptloader.loadSubScript("chrome://zotero/content/include.js");
|
||||
|
||||
// matches "*" and "?" wildcards of a glob pattern, case-insensitive
|
||||
|
|
@ -44,7 +42,7 @@ const findItemByHash = async (libraryID, hash) => {
|
|||
return null;
|
||||
};
|
||||
|
||||
class Zotero_Import_Folder { // eslint-disable-line camelcase,no-unused-vars
|
||||
export class Zotero_Import_Folder {
|
||||
constructor({ mimeTypes = ['application/pdf'], fileTypes, folder, libraryID, recreateStructure }) {
|
||||
this.folder = folder;
|
||||
this.libraryID = libraryID;
|
||||
|
|
@ -130,7 +128,7 @@ class Zotero_Import_Folder { // eslint-disable-line camelcase,no-unused-vars
|
|||
if (prevParentCollectionID) {
|
||||
parentCollection.parentID = prevParentCollectionID;
|
||||
}
|
||||
await parentCollection.saveTx({ skipSelect: true }); //eslint-disable-line no-await-in-loop
|
||||
await parentCollection.saveTx({ skipSelect: true });
|
||||
prevParentCollectionID = parentCollection.id;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue