mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-02 13:14:07 +01:00
Update Dockerfile for sqlite3, update models for cascade delete, fix backup schedule
This commit is contained in:
1 parent
254ba1f089
commit
f73a0cce72
20 files changed
+67
-31
No files matched your search
@@ -39,18 +39,19 @@ module.exports = (sequelize) => {
|
||||
* @param {object} oldLibrary
|
||||
* @returns {Library|null}
|
||||
*/
|
||||
static createFromOld(oldLibrary) {
|
||||
static async createFromOld(oldLibrary) {
|
||||
const library = this.getFromOld(oldLibrary)
|
||||
|
||||
library.libraryFolders = oldLibrary.folders.map(folder => {
|
||||
return {
|
||||
id: folder.id,
|
||||
path: folder.fullPath,
|
||||
libraryId: library.id
|
||||
path: folder.fullPath
|
||||
}
|
||||
})
|
||||
|
||||
return this.create(library).catch((error) => {
|
||||
return this.create(library, {
|
||||
include: sequelize.models.libraryFolder
|
||||
}).catch((error) => {
|
||||
Logger.error(`[Library] Failed to create library ${library.id}`, error)
|
||||
return null
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user