From e4c2b0c8357f9e905fd0b77a6148e4506dca8dd0 Mon Sep 17 00:00:00 2001 From: MuiseDestiny Date: Mon, 8 Jan 2024 18:19:00 +0800 Subject: [PATCH] clean --- package.json | 2 +- src/modules/menu.ts | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 556b64e..58d8deb 100644 --- a/package.json +++ b/package.json @@ -132,4 +132,4 @@ "after:release": "echo Successfully released ${name} v${version} to ${repo.repository}." } } -} \ No newline at end of file +} diff --git a/src/modules/menu.ts b/src/modules/menu.ts index ab4d0ae..f8fc5f8 100644 --- a/src/modules/menu.ts +++ b/src/modules/menu.ts @@ -155,7 +155,7 @@ export default class Menu { for (const item of getAttachmentItems()) { try { const attItem = await renameFile(item); - attItem && showAttachmentItem(attItem) + attItem && showAttachmentItem(attItem); } catch (e) { ztoolkit.log(e); } @@ -170,7 +170,7 @@ export default class Menu { for (const item of getAttachmentItems()) { try { const attItem = await moveFile(item); - attItem && showAttachmentItem(attItem) + attItem && showAttachmentItem(attItem); } catch (e) { ztoolkit.log(e); } @@ -434,7 +434,7 @@ export async function moveFile(attItem: Zotero.Item) { try { await OS.File.move(sourcePath, destPath); } catch (e) { - ztoolkit.log(e) + ztoolkit.log(e); return await moveFile(attItem); } } @@ -447,28 +447,28 @@ export async function moveFile(attItem: Zotero.Item) { const newAttItem = await Zotero.Attachments.linkFromFile(options); window.setTimeout(async () => { // 迁移标注 - ztoolkit.log("迁移标注") + ztoolkit.log("迁移标注"); await Zotero.DB.executeTransaction(async function () { await Zotero.Items.moveChildItems(attItem, newAttItem); }); // 迁移相关 - ztoolkit.log("迁移相关") + ztoolkit.log("迁移相关"); await Zotero.Relations.copyObjectSubjectRelations(attItem, newAttItem); // 迁移索引 - ztoolkit.log("迁移索引") + ztoolkit.log("迁移索引"); await Zotero.DB.executeTransaction(async function () { await Zotero.Fulltext.transferItemIndex(attItem, newAttItem); }); // 迁移标签 - ztoolkit.log("迁移标签") - newAttItem.setTags(attItem.getTags()) + ztoolkit.log("迁移标签"); + newAttItem.setTags(attItem.getTags()); // 迁移PDF笔记 - ztoolkit.log("迁移PDF笔记") - newAttItem.setNote(attItem.getNote()) - await newAttItem.saveTx() + ztoolkit.log("迁移PDF笔记"); + newAttItem.setNote(attItem.getNote()); + await newAttItem.saveTx(); removeEmptyFolder(OS.Path.dirname(sourcePath)); await attItem.eraseTx(); - }) + }); return newAttItem; } @@ -547,8 +547,8 @@ function getCollectionPathsOfItem(item: Zotero.Item) { } return OS.Path.normalize( getCollectionPath(collection.parentID) + - addon.data.folderSep + - collection.name, + addon.data.folderSep + + collection.name, ) as string; }; try {