fx140: Fix folder import

This commit is contained in:
Abe Jellinek 2025-07-02 11:33:36 -04:00 • committed by Dan Stillman
parent fbf0177215
commit e6aba9b879
2 changed files with 3 additions and 5 deletions

View file

@ -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,

View file

@ -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;
}
}