diff --git a/server/scanner/BookScanner.js b/server/scanner/BookScanner.js index 1ef6cea9..a1e7ff50 100644 --- a/server/scanner/BookScanner.js +++ b/server/scanner/BookScanner.js @@ -475,6 +475,8 @@ class BookScanner { bookAuthors: [], bookSeries: [] } + + const createdAtTimestamp = new Date().getTime() if (bookMetadata.authors.length) { for (const authorName of bookMetadata.authors) { const matchingAuthorId = await Database.getAuthorIdByName(libraryItemData.libraryId, authorName) @@ -485,6 +487,8 @@ class BookScanner { } else { // New author bookObject.bookAuthors.push({ + // Ensures authors are in a set order + createdAt: createdAtTimestamp + bookObject.bookAuthors.length, author: { libraryId: libraryItemData.libraryId, name: authorName,