Skip to content

Commit

Permalink
fix: increase exec buffer size to 100mb to avoid error on import (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
bandantonio authored Apr 2, 2024
1 parent b4ef288 commit 9bc1404
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export default class IBookHighlightsPlugin extends Plugin {

const command = `echo "${booksSql}" | sqlite3 ${IBOOK_LIBRARY} -json`;
const exec = promisify(child_process.exec);
const { stdout, stderr } = await exec(command);
// Issue #11 - Temporary set maxBuffer to 100MB
// TODO: Need a more efficient solution to handle large data
const { stdout, stderr } = await exec(command, { maxBuffer: 100 * 1024 * 1024 });

if (stderr) {
new Notice(stderr);
Expand All @@ -93,7 +95,9 @@ export default class IBookHighlightsPlugin extends Plugin {

const command = `echo "${annotationsSql}" | sqlite3 ${IBOOK_ANNOTATION_DB} -json`;
const exec = promisify(child_process.exec);
const { stdout, stderr } = await exec(command);
// Issue #11 - Temporary set maxBuffer to 100MB
// TODO: Need a more efficient solution to handle large data
const { stdout, stderr } = await exec(command, { maxBuffer: 100 * 1024 * 1024 });

if (stderr) {
new Notice(stderr);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "apple-books-import-highlights",
"name": "Apple Books - Import Highlights",
"version": "1.2.0",
"version": "1.2.1",
"minAppVersion": "0.15.0",
"description": "Import your Apple Books highlights and notes to Obsidian.",
"author": "bandantonio",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-apple-books-highlights-plugin",
"version": "1.2.0",
"version": "1.2.1",
"description": "Import highlights and notes from your Apple Books to Obsidian",
"main": "main.js",
"scripts": {
Expand Down Expand Up @@ -42,4 +42,4 @@
"handlebars": "^4.7.8",
"sqlite3": "^5.1.7-rc.0"
}
}
}

0 comments on commit 9bc1404

Please sign in to comment.