mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-03 16:59:41 +00:00
Update:Replace library scan toast with task manager #1279
This commit is contained in:
parent
6f65350269
commit
bef6549805
7 changed files with 61 additions and 19 deletions
|
|
@ -28,5 +28,21 @@ class TaskManager {
|
|||
SocketAuthority.emitter('task_finished', task.toJSON())
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new task and add
|
||||
*
|
||||
* @param {string} action
|
||||
* @param {string} title
|
||||
* @param {string} description
|
||||
* @param {boolean} showSuccess
|
||||
* @param {Object} [data]
|
||||
*/
|
||||
createAndAddTask(action, title, description, showSuccess, data = {}) {
|
||||
const task = new Task()
|
||||
task.setData(action, title, description, showSuccess, data)
|
||||
this.addTask(task)
|
||||
return task
|
||||
}
|
||||
}
|
||||
module.exports = new TaskManager()
|
||||
Loading…
Add table
Add a link
Reference in a new issue