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

Closed
opened 2026-02-20 10:13:45 -05:00 by deekerman · 5 comments
Owner

Originally created by @ahobsonsayers on GitHub (Apr 17, 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

Originally created by @ahobsonsayers on GitHub (Apr 17, 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.](https://github.com/ahobsonsayers/abs-goodreads) 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. ```bash [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
deekerman 2026-02-20 10:13:45 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@nichwall commented on GitHub (Apr 17, 2024):

Is this fixed by https://github.com/advplyr/audiobookshelf/pull/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)

@nichwall commented on GitHub (Apr 17, 2024): Is this fixed by https://github.com/advplyr/audiobookshelf/pull/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)
Author
Owner

@ahobsonsayers commented on GitHub (Apr 18, 2024):

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!

@ahobsonsayers commented on GitHub (Apr 18, 2024): 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!
Author
Owner

@nichwall commented on GitHub (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

@nichwall commented on GitHub (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
Author
Owner

@advplyr commented on GitHub (Apr 18, 2024):

Thanks just fixed that curly bracket issue

@advplyr commented on GitHub (Apr 18, 2024): Thanks just fixed that curly bracket issue
Author
Owner

@advplyr commented on GitHub (Apr 22, 2024):

Fixed in v2.9.0

@advplyr commented on GitHub (Apr 22, 2024): Fixed in [v2.9.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.9.0)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/audiobookshelf-advplyr#1894
No description provided.