From 20fb8bcfb7255b6362f2d7f6b6e3590fdd0e778f Mon Sep 17 00:00:00 2001 From: Hatton Date: Mon, 29 Apr 2024 07:56:59 -0600 Subject: [PATCH] feat: open .bloom and .bloomSource --- package.json | 12 +++++++++++- src/main/index.ts | 6 ++++-- src/renderer/index.tsx | 4 ++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ea93c74..868805a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bloompub-viewer", - "version": "1.0.10", + "version": "1.1.0", "author": "Bloom Devs", "description": "Viewer for Bloom Digital books", "license": "MIT", @@ -47,6 +47,16 @@ "ext": "bloomPUB", "name": "BloomPUB File", "role": "Viewer" + }, + { + "ext": "bloom", + "name": "Bloom Source Book File", + "role": "Viewer" + }, + { + "ext": "bloomSource", + "name": "Bloom Source Book File", + "role": "Viewer" } ] }, diff --git a/src/main/index.ts b/src/main/index.ts index e812f06..2ee73f6 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -252,8 +252,10 @@ ipcMain.on("unpack-zip-file", (event, zipFilePath) => { zipFilePath.length ); filename = bookTitle - .replace(/\.bloomd/gi, ".htm") - .replace(/\.bloompub/gi, ".htm"); + .replace(/\.bloomd$/gi, ".htm") + .replace(/\.bloompub$/gi, ".htm") + .replace(/\.bloomsource$/gi, ".htm") + .replace(/\.bloom$/gi, ".htm"); if (!fs.existsSync(Path.join(unpackedFolder, filename))) { // maybe it's the old format AND the user changed the name filename = diff --git a/src/renderer/index.tsx b/src/renderer/index.tsx index 37bd9fa..7715e83 100644 --- a/src/renderer/index.tsx +++ b/src/renderer/index.tsx @@ -110,6 +110,10 @@ export function showOpenFile() { name: "BloomPUB Book", extensions: ["bloomd", "bloompub"], }, + { + name: "Bloom Source Book", + extensions: ["bloom", "bloomSource"], + }, ], }; window.electronApi.showOpenDialog(options, (filepath: string) => {