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

"Extract" Button stays red and unclickable #362

Open
s3raphic opened this issue Nov 5, 2024 · 10 comments
Open

"Extract" Button stays red and unclickable #362

s3raphic opened this issue Nov 5, 2024 · 10 comments

Comments

@s3raphic
Copy link

s3raphic commented Nov 5, 2024

Hi there,

When I click "choose file" and select "koboreader.sqlite", the "extract" button remains red and I can't click it. Is there something in the settings I need to adjust first?

Thanks!

@markedwardcampos
Copy link

+1, in my vault and in Sandbox:

My Vault

SYSTEM INFO:
Obsidian version: v1.7.5
Installer version: v1.7.5
Operating system: Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:23 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6031 24.1.0
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: Minimal v7.7.18
Snippets enabled: 1
Restricted mode: off
Plugins installed: 7
Plugins enabled: 7
1: Git v2.28.2
2: Advanced Tables v0.22.1
3: Tasks v7.13.0
4: Style Settings v1.0.9
5: Minimal Theme Settings v8.1.1
6: Dataview v0.5.67
7: Kobo Highlights Importer v2.0.0

RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Sandbox (same behavior):

SYSTEM INFO:
Obsidian version: v1.7.5
Installer version: v1.7.5
Operating system: Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:23 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6031 24.1.0
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 1
Plugins enabled: 1
1: Kobo Highlights Importer v2.0.0

RECOMMENDATIONS:
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

@cyprienflx
Copy link

+1

i have the same issue on windows 11 and Macos :/

@chigh
Copy link

chigh commented Nov 20, 2024

Same, I've even tried opening a backup copy of the sqlite database that's on my laptop.

@danicotillas
Copy link

Please try to fix this!!!! I really enjoy this plugin

@FrnklyN
Copy link

FrnklyN commented Dec 14, 2024

I fixed the main.js file. Change this:

this.inputFileEl.addEventListener("change", (ev) => {
  const file = ev.target.files[0];
  if (!file) {
    console.error("No file selected");
    return;
  }

  // Convert File to ArrayBuffer
  const reader = new FileReader();
  reader.onload = () => {
    this.fileBuffer = reader.result;  // Store the ArrayBuffer
    this.goButtonEl.disabled = false;
    this.goButtonEl.setAttr("style", "background-color: green; color: black");
    new import_obsidian2.Notice("Ready to extract!");
  };

  reader.onerror = (error) => {
    console.error("FileReader error:", error);
    new import_obsidian2.Notice("Error reading file");
  };

  reader.readAsArrayBuffer(file);
});

And:

fetchHighlights() {
  return __async(this, null, function* () {
    if (!this.fileBuffer) {
      throw new Error("No file buffer available...");
    }
    
    const SQLEngine = yield (0, import_sql.default)({
      wasmBinary: binary
    });
    
    // Use the buffer directly instead of reading from file
    const db = new SQLEngine.Database(new Uint8Array(this.fileBuffer));
    
    const service = new HighlightService(
      new Repository(db)
    );

    // Rest of the function remains the same...
  });
}

@danicotillas
Copy link

danicotillas commented Dec 16, 2024

Thanks @FrnklyN but would you mind to share a main.js file with the changes included?
I'm not very proficient at coding and I don't know where to change that exactly.

Thanks!

@cyprienflx
Copy link

cyprienflx commented Dec 16, 2024

i found a workaround with koreader https://koreader.rocks/

I install this on my Kobo, and now I can export my note in Markdown 🎉

@Xethgnur
Copy link

I am also unable to extract. Whether its the .sqlite file on the device or offloaded into my desktop, the extraction button doesn't change and remains locked.

Unfortunately I am not code Savvy and have no idea what needs to be replaced in the Main.js file via @FrnklyN's find/fix

@chigh
Copy link

chigh commented Dec 17, 2024

This worked like a charm! Thanks, @FrnklyN!

I fixed the main.js file. Change this:

--8<--

@danicotillas
Copy link

This worked like a charm! Thanks, @FrnklyN!

I fixed the main.js file. Change this:

--8<--

Please! Can you copy/paste here he complete code of the main.js file so I can replicate on mine???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants