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,7 +1,7 @@
const Path = require('path')
const fs = require('fs-extra')
const { bytesPretty, elapsedPretty, readTextFile } = require('../utils/fileUtils')
const { comparePaths, getIno } = require('../utils/index')
const { comparePaths, getIno, getId } = require('../utils/index')
const { parseOpfMetadataXML } = require('../utils/parseOpfMetadata')
const { extractCoverArt } = require('../utils/ffmpegHelpers')
const nfoGenerator = require('../utils/nfoGenerator')
@ -317,7 +317,7 @@ class Audiobook {
}
setData(data) {
this.id = (Math.trunc(Math.random() * 1000) + Date.now()).toString(36)
this.id = getId('ab')
this.libraryId = data.libraryId || 'main'
this.folderId = data.folderId || 'audiobooks'
this.ino = data.ino || null