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

@ -3,6 +3,7 @@ const EventEmitter = require('events')
const Path = require('path')
const fs = require('fs-extra')
const Logger = require('../Logger')
const { getId } = require('../utils/index')
const { secondsToTimestamp } = require('../utils/fileUtils')
const { writeConcatFile } = require('../utils/ffmpegHelpers')
const hlsPlaylistGenerator = require('../utils/hlsPlaylistGenerator')
@ -13,7 +14,7 @@ class Stream extends EventEmitter {
constructor(streamPath, client, audiobook, transcodeOptions = {}) {
super()
this.id = (Date.now() + Math.trunc(Math.random() * 1000)).toString(36)
this.id = getId('str')
this.client = client
this.audiobook = audiobook