From a5750deaaf824e99fec54848640c21d5395dd626 Mon Sep 17 00:00:00 2001 From: "Tomasz N." Date: Wed, 22 Oct 2025 23:02:49 +0200 Subject: [PATCH 1/3] The key change: Move the Database.bookAuthorModel.create() block outside the if (!author) check, so it runs whether the author was just created OR already existed in the database. This bug was visible when using "Match Books" for a library and the outcome was books had no author(s) assigned despite the custom providers correctly providing those values. --- server/scanner/Scanner.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/scanner/Scanner.js b/server/scanner/Scanner.js index 206068cc4..cf5c87b78 100644 --- a/server/scanner/Scanner.js +++ b/server/scanner/Scanner.js @@ -259,7 +259,7 @@ class Scanner { SocketAuthority.emitter('author_added', author.toOldJSON()) // Update filter data Database.addAuthorToFilterData(libraryItem.libraryId, author.name, author.id) - + } await Database.bookAuthorModel .create({ authorId: author.id, @@ -270,7 +270,6 @@ class Scanner { libraryItem.media.authors.push(author) hasAuthorUpdates = true }) - } } const authorsRemoved = libraryItem.media.authors.filter((a) => !matchData.author.find((ma) => ma.toLowerCase() === a.name.toLowerCase())) if (authorsRemoved.length) { From 372c9a5322bca988f66c4d714067bfa5a9922ac8 Mon Sep 17 00:00:00 2001 From: "Tomasz N." Date: Fri, 31 Oct 2025 15:36:47 +0100 Subject: [PATCH 2/3] Increasing the timeout for bookfinder - some metadata providers heavily throttle the requests, original 10s is not enough. --- server/finders/BookFinder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/finders/BookFinder.js b/server/finders/BookFinder.js index fe1a61027..c25afe075 100644 --- a/server/finders/BookFinder.js +++ b/server/finders/BookFinder.js @@ -11,7 +11,7 @@ const { levenshteinDistance, levenshteinSimilarity, escapeRegExp, isValidASIN } const htmlSanitizer = require('../utils/htmlSanitizer') class BookFinder { - #providerResponseTimeout = 10000 + #providerResponseTimeout = 120000 constructor() { this.openLibrary = new OpenLibrary() From 961d066bdd5d18efa2d8774362b2b236a8ca2d82 Mon Sep 17 00:00:00 2001 From: "Tomasz N." Date: Fri, 31 Oct 2025 15:39:12 +0100 Subject: [PATCH 3/3] Wrong branch. --- server/finders/BookFinder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/finders/BookFinder.js b/server/finders/BookFinder.js index c25afe075..fe1a61027 100644 --- a/server/finders/BookFinder.js +++ b/server/finders/BookFinder.js @@ -11,7 +11,7 @@ const { levenshteinDistance, levenshteinSimilarity, escapeRegExp, isValidASIN } const htmlSanitizer = require('../utils/htmlSanitizer') class BookFinder { - #providerResponseTimeout = 120000 + #providerResponseTimeout = 10000 constructor() { this.openLibrary = new OpenLibrary()