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

[Bug] Custom metadata provider including extra curly bracket in query string #2860

Closed
ahobsonsayers opened this issue Apr 18, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@ahobsonsayers
Copy link
Contributor

ahobsonsayers commented Apr 18, 2024

Describe the issue

I have recently built a custom metadata provider for audiobookshelf which gets metadata from Goodreads. You can see my repo here.

I have created my provider using the OpenAPI schema written for audiobookshelf custom metadata providers. The provider works well when invoked through curl.

However when I set up the provider in audiobookshelf and attempt to use it to get metadata for a book, audiobookshelf instantly crashes with the error below. No request is ever made to my metadata provider server.

[2024-04-13 18:45:56.714] FATAL: [Server] Unhandled rejection: Error: Custom provider not found for the given id, promise: Promise {
  <rejected> Error: Custom provider not found for the given id
    at CustomProviderAdapter.search (/server/providers/CustomProviderAdapter.js:22:19)
    at async BookFinder.getCustomProviderResults (/server/finders/BookFinder.js:161:19)
} (Server.js:164)

I'm not particularly familiar with JavaScript or audiobookshelf so I am not able to debug why this is happening myself. Any help would be much appreciated - I'd love to get my metadata provider working!

Steps to reproduce the issue

  1. Run my custom metadata provider (using docker - see readme)
  2. Set up my provider in audiobookshelf (see readme)
  3. Attempt to use metadata providers
  4. audiobookshelf crashes

Audiobookshelf version

v2.8.1

How are you running audiobookshelf?

Docker

@ahobsonsayers ahobsonsayers added the bug Something isn't working label Apr 18, 2024
@nichwall
Copy link
Contributor

Is this fixed by #2784? That PR occurred after the last release (2.8.1).

You can try running from source or using the edge docker tag to test the new version.

Thanks for linking to your custom metadata provider! We're planning to add a "community made providers" table to the website if you would like to add a link to the repo (once it's ready)

@ahobsonsayers
Copy link
Contributor Author

Thanks for your reply!

This does indeed fix the issue - edge does not crash!

I have noticed another problem though. It seems like audiobookshelf is always appending a %7D to the end of the query, in other words a }

This breaks search on my server as it seems Goodreads does not accept the character. I should probably sanitise any input anyway, but I don't think audiobookshelf should be sending this. I assume it is a result of a string interpolation bug maybe?

Many thanks!

@nichwall
Copy link
Contributor

nichwall commented Apr 18, 2024

Oh yeah that should be fixed. Looks like there's one too many closing braces. (Not at a computer I can edit with for most of the day so leaving this here)

https://github.com/advplyr/audiobookshelf/blob/master/server%2Fproviders%2FCustomProviderAdapter.js#L46

@advplyr advplyr changed the title Crash when using a custom metadata provider [Bug] Custom metadata provider including extra curly bracket in query string Apr 18, 2024
@advplyr advplyr added the awaiting release Issue is resolved and will be in the next release label Apr 18, 2024
@advplyr
Copy link
Owner

advplyr commented Apr 18, 2024

Thanks just fixed that curly bracket issue

@advplyr
Copy link
Owner

advplyr commented Apr 22, 2024

Fixed in v2.9.0

@advplyr advplyr closed this as completed Apr 22, 2024
@advplyr advplyr removed the awaiting release Issue is resolved and will be in the next release label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants