farling42 / obsidian-import-json

Plug-in for Obsidian.md which will create Notes from JSON files
MIT License
85 stars 5 forks source link

Silently fails on a JSON file that has entries per line #39

Closed gbraad closed 1 year ago

gbraad commented 1 year ago

I have a JSON file that uses a json-object per line, so it does not use the [ and ] to start with.

Unfortunately, no error is returned from the UI and just returns. Only the non-whitespace issue is shown on the console.

farling42 commented 1 year ago

Hi, this sounds like you are trying to something like a foundry db file.

The importer will only read the first object from a JSON file, so it will only manage the first in your file.

I have not updated the README file to explain that only the first object is read from a JSON file.

gbraad commented 1 year ago

Thanks for the info. I just added a [, replaced line-endings with , and ended with ]. Worked...

It wasn't a Foundry db file, but similar. It was a large extract of a dictionary. I have decided it is better to write a plugin to do actual lookups as a test the filesystem started to inflate the actual on-disk size for the markdown files and performance was abysmal ;-).

Also handling the uncaught exception (showing the user that an error occurred might prevent raised eyebrows; 'darn, that was fast... oh, nothing happened... why?').