mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-02 21:24:08 +01:00
Add socket event to remove download, fix clearInterval on stream loop
This commit is contained in:
1 parent
80f90907d4
commit
11f4caffa8
5 files changed
+26
-3
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user