Fix: book id length & check duplicate ids, Change: library to lazy load book cards

This commit is contained in:
advplyr
2021-11-15 20:09:42 -06:00
parent ca6f2c01f6
commit 72f9732b67
18 changed files with 466 additions and 86 deletions

View File

@ -1,3 +1,5 @@
const { getId } = require("../utils")
class Folder {
constructor(folder = null) {
this.id = null
@ -27,7 +29,7 @@ class Folder {
}
setData(data) {
this.id = data.id ? data.id : 'fol' + (Math.trunc(Math.random() * 1000) + Date.now()).toString(36)
this.id = data.id ? data.id : getId('fol')
this.fullPath = data.fullPath
this.libraryId = data.libraryId
this.addedAt = Date.now()