mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-22 00:49:10 +02:00
Fix:getNarrators API endpoint check narrators are strings #1770
This commit is contained in:
parent
b0bf9604bb
commit
bac09de23d
2 changed files with 8 additions and 6 deletions
|
@ -709,9 +709,11 @@ class LibraryController {
|
|||
async getNarrators(req, res) {
|
||||
const narrators = {}
|
||||
req.libraryItems.forEach((li) => {
|
||||
if (li.media.metadata.narrators && li.media.metadata.narrators.length) {
|
||||
if (li.media.metadata.narrators?.length) {
|
||||
li.media.metadata.narrators.forEach((n) => {
|
||||
if (!narrators[n]) {
|
||||
if (typeof n !== 'string') {
|
||||
Logger.error(`[LibraryController] getNarrators: Invalid narrator "${n}" on book "${li.media.metadata.title}"`)
|
||||
} else if (!narrators[n]) {
|
||||
narrators[n] = {
|
||||
id: encodeURIComponent(Buffer.from(n).toString('base64')),
|
||||
name: n,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue