mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-12 18:35:00 +02:00
Update user progress reset and delete logic
This commit is contained in:
parent
9107620b3c
commit
5dd1542af0
6 changed files with 28 additions and 7 deletions
|
@ -205,16 +205,20 @@ class Stream extends EventEmitter {
|
|||
}
|
||||
|
||||
startLoop() {
|
||||
// Logger.info(`[Stream] ${this.audiobookTitle} (${this.id}) Start Loop`)
|
||||
this.socket.emit('stream_progress', { stream: this.id, chunks: [], numSegments: 0, percent: '0%' })
|
||||
this.loop = setInterval(() => {
|
||||
|
||||
clearInterval(this.loop)
|
||||
var intervalId = setInterval(() => {
|
||||
if (!this.isTranscodeComplete) {
|
||||
this.checkFiles()
|
||||
} else {
|
||||
Logger.info(`[Stream] ${this.audiobookTitle} sending stream_ready`)
|
||||
this.socket.emit('stream_ready')
|
||||
clearInterval(this.loop)
|
||||
clearInterval(intervalId)
|
||||
}
|
||||
}, 2000)
|
||||
this.loop = intervalId
|
||||
}
|
||||
|
||||
async start() {
|
||||
|
@ -260,13 +264,16 @@ class Stream extends EventEmitter {
|
|||
|
||||
this.ffmpeg.on('start', (command) => {
|
||||
Logger.info('[INFO] FFMPEG transcoding started with command: ' + command)
|
||||
Logger.info('')
|
||||
if (this.isResetting) {
|
||||
setTimeout(() => {
|
||||
Logger.info('[STREAM] Clearing isResetting')
|
||||
this.isResetting = false
|
||||
this.startLoop()
|
||||
}, 500)
|
||||
} else {
|
||||
this.startLoop()
|
||||
}
|
||||
this.startLoop()
|
||||
})
|
||||
|
||||
this.ffmpeg.on('stderr', (stdErrline) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue