From 666a4c072b556c9a063d1f4bb7d97082ba5465a5 Mon Sep 17 00:00:00 2001 From: YukiGasai Date: Mon, 20 Mar 2023 19:53:21 +0100 Subject: [PATCH] Worked on event note file name #92 --- src/helper/AutoEventNoteCreator.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/helper/AutoEventNoteCreator.ts b/src/helper/AutoEventNoteCreator.ts index 197edd3..8c0118a 100644 --- a/src/helper/AutoEventNoteCreator.ts +++ b/src/helper/AutoEventNoteCreator.ts @@ -180,7 +180,9 @@ async function getEventNoteFilePath(plugin: GoogleCalendarPlugin, event: GoogleE folderPath = app.fileManager.getNewFileParent("").path; } - const sanitizedFileName = replacePathPlaceholders(plugin, event, sanitizeFileName(plugin.settings.eventNoteNameFormat)) + const fileName = replacePathPlaceholders(plugin, event, plugin.settings.eventNoteNameFormat); + + const sanitizedFileName = replacePathPlaceholders(plugin, event, sanitizeFileName(fileName)) return normalizePath(`${folderPath}/${sanitizedFileName}.md`); } @@ -214,9 +216,9 @@ export const createNoteFromEvent = async (event: GoogleEvent, folderName?: strin if (folderName) { folderName = replacePathPlaceholders(plugin, event, folderName); } - + console.log("folderName", folderName) const filePath = await getEventNoteFilePath(plugin, event, folderName); - + console.log("folderName", filePath) //check if file already exists const existingFile = await checkIfFileExists(event, filePath, isAutoCreated); if (existingFile) return existingFile;