mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-09 17:04:58 +02:00
Add socket event to remove download, fix clearInterval on stream loop
This commit is contained in:
parent
80f90907d4
commit
11f4caffa8
5 changed files with 26 additions and 3 deletions
|
@ -49,6 +49,15 @@ class DownloadManager {
|
|||
this.prepareDownload(client, audiobook, options)
|
||||
}
|
||||
|
||||
removeSocketRequest(socket, downloadId) {
|
||||
var download = this.downloads.find(d => d.id === downloadId)
|
||||
if (!download) {
|
||||
Logger.error('Remove download request download not found ' + downloadId)
|
||||
return
|
||||
}
|
||||
this.removeDownload(download)
|
||||
}
|
||||
|
||||
async prepareDownload(client, audiobook, options = {}) {
|
||||
var downloadId = (Math.trunc(Math.random() * 1000) + Date.now()).toString(36)
|
||||
var dlpath = Path.join(this.downloadDirPath, downloadId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue