mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-08 21:09:37 +00:00
Fix: book id length & check duplicate ids, Change: library to lazy load book cards
This commit is contained in:
parent
ca6f2c01f6
commit
72f9732b67
18 changed files with 466 additions and 86 deletions
|
|
@ -1,5 +1,6 @@
|
|||
const Logger = require('../Logger')
|
||||
const date = require('date-and-time')
|
||||
const { getId } = require('../utils/index')
|
||||
|
||||
class UserListeningSession {
|
||||
constructor(session) {
|
||||
|
|
@ -58,7 +59,7 @@ class UserListeningSession {
|
|||
}
|
||||
|
||||
setData(audiobook, user) {
|
||||
this.id = 'ls_' + (Math.trunc(Math.random() * 1000) + Date.now()).toString(36)
|
||||
this.id = getId('ls')
|
||||
this.userId = user.id
|
||||
this.audiobookId = audiobook.id
|
||||
this.audiobookTitle = audiobook.title || ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue