mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-10 14:52:51 +02:00
Add:Cancel m4b merge button #1008
This commit is contained in:
@@ -22,6 +22,14 @@ class AbMergeManager {
|
||||
this.pendingTasks = []
|
||||
}
|
||||
|
||||
getPendingTaskByLibraryItemId(libraryItemId) {
|
||||
return this.pendingTasks.find(t => t.task.data.libraryItemId === libraryItemId)
|
||||
}
|
||||
|
||||
cancelEncode(task) {
|
||||
return this.removeTask(task, true)
|
||||
}
|
||||
|
||||
async ensureDownloadDirPath() { // Creates download path if necessary and sets owner and permissions
|
||||
if (this.downloadDirPathExist) return
|
||||
|
||||
@@ -223,6 +231,7 @@ class AbMergeManager {
|
||||
if (pendingDl.worker) {
|
||||
try {
|
||||
pendingDl.worker.postMessage('STOP')
|
||||
return
|
||||
} catch (error) {
|
||||
Logger.error('[AbMergeManager] Error posting stop message to worker', error)
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class TaskManager {
|
||||
|
||||
taskFinished(task) {
|
||||
if (this.tasks.some(t => t.id === task.id)) {
|
||||
this.tasks = this.tasks.filter(t => t !== task.id)
|
||||
this.tasks = this.tasks.filter(t => t.id !== task.id)
|
||||
this.emitter('task_finished', task.toJSON())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user