mProjectsCode / obsidian-media-db-plugin

A plugin that can query multiple APIs for movies, series, anime, games, music and wiki articles, and import them into your vault.
GNU General Public License v3.0
255 stars 31 forks source link

Add book support using the OpenLibrary API #105

Closed ltctceplrm closed 1 year ago

ltctceplrm commented 1 year ago

I've tested it out with a bunch of books and it seems to work fine but please let me know if I made a mistake somewhere. Hopefully this fulfills #102 and partially #3

mProjectsCode commented 1 year ago

The code LGTM. But it would be good to add a description of the new API to the readme.

ltctceplrm commented 1 year ago

Thank you for looking over the code, I've added documentation for the new API to the readme.

mProjectsCode commented 1 year ago

Great. Thanks for the PR.

ltctceplrm commented 1 year ago

Huh it looks like my changes may have broken the Movie and TV Series search modal somehow, when I try to add a movie it gives me an error saying Type Error: data.docs isn't iterable (which is only used in OpenLibraryAPI.ts) but if I use the omdbapi through the API search modal rather than movie search then it works correctly. I'm not sure where my mistake is

mProjectsCode commented 1 year ago

i haven't tested the code yet, but i will test and fix it before i release it

ltctceplrm commented 1 year ago

Perfect, thank you.

mProjectsCode commented 1 year ago

I can not reproduce the error @ltctceplrm

mProjectsCode commented 1 year ago

The movie search works fine for me

ltctceplrm commented 1 year ago

Hmm would it be possible that something went wrong when I ran the yarn build command and that there's actually nothing wrong with the code itself? I did have some dependency problems at first. I'll try to reinstall it and rebuild the main.js file and see if the problem is fixed.

ltctceplrm commented 1 year ago

I reinstalled yarn and retried the build process and this time I don't get the error when adding movies so now I'm sure that there was just something wrong with my installation rather than the plugin code.