mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-08 10:21:38 +00:00
Add logging when author normalization is empty
This commit is contained in:
parent
6b97fc0ce6
commit
c814a84b27
3 changed files with 12 additions and 2 deletions
|
|
@ -480,7 +480,10 @@ class Book extends Model {
|
|||
const authorsAdded = []
|
||||
for (const authorName of newAuthorNames) {
|
||||
const { author, created } = await authorModel.findOrCreateByNameAndLibrary(authorName, libraryId)
|
||||
if (!author) continue
|
||||
if (!author) {
|
||||
Logger.warn(`[Book] "${this.title}" skipped author "${authorName}" because normalized name was empty`)
|
||||
continue
|
||||
}
|
||||
await bookAuthorModel.create({ bookId: this.id, authorId: author.id })
|
||||
if (created) {
|
||||
SocketAuthority.emitter('author_added', author.toOldJSON())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue