Add socket event to remove download, fix clearInterval on stream loop

This commit is contained in:
Mark Cooper committed 2021-09-12 16:10:12 -05:00
1 parent 80f90907d4
commit 11f4caffa8
5 files changed
+26 -3

No files matched your search

+6 -1
View File
@@ -43,6 +43,10 @@ class Stream extends EventEmitter {
return this.audiobook.id
}
get audiobookTitle() {
return this.audiobook ? this.audiobook.title : null
}
get totalDuration() {
return this.audiobook.totalDuration
}
@@ -206,8 +210,9 @@ class Stream extends EventEmitter {
if (!this.isTranscodeComplete) {
this.checkFiles()
} else {
Logger.info(`[Stream] ${this.audiobookTitle} sending stream_ready`)
this.socket.emit('stream_ready')
clearTimeout(this.loop)
clearInterval(this.loop)
}
}, 2000)
}