diff --git a/Utils.ts b/Utils.ts index 2d966db..047f9d8 100644 --- a/Utils.ts +++ b/Utils.ts @@ -2,8 +2,18 @@ import { App, TFile, TFolder, normalizePath } from 'obsidian'; export async function saveFile(app: App, audioBlob: Blob, fileName: string, path: string): Promise { try { - const normalizedPath = normalizePath(path); - const filePath = `${normalizedPath}/${fileName}`; + + let normalizedPath: string; + try { + normalizedPath = normalizePath(path); + if (!normalizedPath) { + console.warn('Normalized path is invalid, using root path'); + normalizedPath = '/'; // Set to root path of the vault + } + } catch (error) { + console.warn('Error normalizing path, using root path:', error); + normalizedPath = '/'; // Set to root path of the vault + } const filePath = `${normalizedPath}/${fileName}`; await ensureDirectoryExists(app, normalizedPath); diff --git a/whisper.cpp b/whisper.cpp new file mode 160000 index 0000000..c118733 --- /dev/null +++ b/whisper.cpp @@ -0,0 +1 @@ +Subproject commit c118733a29ad4a984015a5c08fd585086d01087a