Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: increase exec buffer size to 100mb to avoid error on import #14

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}
}