mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-13 02:19:46 +01:00
Fix: book id length & check duplicate ids, Change: library to lazy load book cards
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const Folder = require('./Folder')
|
||||
const { getId } = require('../utils/index')
|
||||
|
||||
class Library {
|
||||
constructor(library = null) {
|
||||
@@ -46,7 +47,7 @@ class Library {
|
||||
}
|
||||
|
||||
setData(data) {
|
||||
this.id = data.id ? data.id : 'lib' + (Math.trunc(Math.random() * 1000) + Date.now()).toString(36)
|
||||
this.id = data.id ? data.id : getId('lib')
|
||||
this.name = data.name
|
||||
if (data.folder) {
|
||||
this.folders = [
|
||||
|
||||
Reference in New Issue
Block a user