mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-19 18:34:25 +02:00
Add bulkInsertEntities to db to handle migrating large collections
This commit is contained in:
parent
399e0ea0bc
commit
7b3f9a1e0c
2 changed files with 35 additions and 2 deletions
|
@ -242,10 +242,10 @@ async function migrateLibraryItems(db) {
|
|||
var libraryItems = audiobooks.map((ab) => makeLibraryItemFromOldAb(ab))
|
||||
|
||||
Logger.info(`>>> ${libraryItems.length} Library Items made`)
|
||||
await db.insertEntities('libraryItem', libraryItems)
|
||||
await db.bulkInsertEntities('libraryItem', libraryItems)
|
||||
if (authorsToAdd.length) {
|
||||
Logger.info(`>>> ${authorsToAdd.length} Authors made`)
|
||||
await db.insertEntities('author', authorsToAdd)
|
||||
await db.bulkInsertEntities('author', authorsToAdd)
|
||||
}
|
||||
if (seriesToAdd.length) {
|
||||
Logger.info(`>>> ${seriesToAdd.length} Series made`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue