Add:Tasks widget in appbar for merging m4bs & remove old m4b merge routes

This commit is contained in:
advplyr 2022-10-02 14:16:17 -05:00
parent 441b8c5bb7
commit 39979ff8a3
16 changed files with 285 additions and 457 deletions

View file

@ -0,0 +1,20 @@
class TaskManager {
constructor(emitter) {
this.emitter = emitter
this.tasks = []
}
addTask(task) {
this.tasks.push(task)
this.emitter('task_started', task.toJSON())
}
taskFinished(task) {
if (this.tasks.some(t => t.id === task.id)) {
this.tasks = this.tasks.filter(t => t !== task.id)
this.emitter('task_finished', task.toJSON())
}
}
}
module.exports = TaskManager