mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-24 04:11:39 +00:00
Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c009db9f28 | ||
|
|
325469c5a5 | ||
|
|
c97b36e11c | ||
|
|
e944b2a2f5 |
2 changed files with 4 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
const { Op } = require('sequelize')
|
const { Op } = require('sequelize')
|
||||||
|
const uuid = require('uuid')
|
||||||
|
|
||||||
const Database = require('../Database')
|
const Database = require('../Database')
|
||||||
const Logger = require('../Logger')
|
const Logger = require('../Logger')
|
||||||
|
|
@ -115,6 +116,7 @@ class TokenManager {
|
||||||
const payload = {
|
const payload = {
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
username: user.username,
|
username: user.username,
|
||||||
|
jti: uuid.v4(),
|
||||||
type: 'access'
|
type: 'access'
|
||||||
}
|
}
|
||||||
const options = {
|
const options = {
|
||||||
|
|
@ -138,6 +140,7 @@ class TokenManager {
|
||||||
const payload = {
|
const payload = {
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
username: user.username,
|
username: user.username,
|
||||||
|
jti: uuid.v4(),
|
||||||
type: 'refresh'
|
type: 'refresh'
|
||||||
}
|
}
|
||||||
const options = {
|
const options = {
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ class AuthorController {
|
||||||
})
|
})
|
||||||
if (libraryItems.length) {
|
if (libraryItems.length) {
|
||||||
await Database.bookAuthorModel.removeByIds(req.author.id) // Remove all old BookAuthor
|
await Database.bookAuthorModel.removeByIds(req.author.id) // Remove all old BookAuthor
|
||||||
await Database.bookAuthorModel.bulkCreate(bookAuthorsToCreate) // Create all new BookAuthor
|
await Database.bookAuthorModel.bulkCreate(bookAuthorsToCreate, { ignoreDuplicates: true }) // Create all new unique BookAuthor
|
||||||
for (const libraryItem of libraryItems) {
|
for (const libraryItem of libraryItems) {
|
||||||
await libraryItem.saveMetadataFile()
|
await libraryItem.saveMetadataFile()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue