Skip to content

Commit

Permalink
Merge pull request #31 from BloomBooks/MoreExtensions
Browse files Browse the repository at this point in the history
feat: open .bloom and .bloomSource
  • Loading branch information
JohnThomson authored Apr 29, 2024
2 parents d425ddd + 20fb8bc commit 9cfca0a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
}
]
},
Expand Down
6 changes: 4 additions & 2 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 9cfca0a

Please sign in to comment.