mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-13 02:45:02 +02:00
Add:Batch re-scan #1754
This commit is contained in:
parent
2fa73f7a8d
commit
b52e240025
11 changed files with 159 additions and 50 deletions
|
@ -9,6 +9,7 @@ class Task {
|
|||
this.title = null
|
||||
this.description = null
|
||||
this.error = null
|
||||
this.showSuccess = false // If true client side should keep the task visible after success
|
||||
|
||||
this.isFailed = false
|
||||
this.isFinished = false
|
||||
|
@ -25,6 +26,7 @@ class Task {
|
|||
title: this.title,
|
||||
description: this.description,
|
||||
error: this.error,
|
||||
showSuccess: this.showSuccess,
|
||||
isFailed: this.isFailed,
|
||||
isFinished: this.isFinished,
|
||||
startedAt: this.startedAt,
|
||||
|
@ -32,12 +34,13 @@ class Task {
|
|||
}
|
||||
}
|
||||
|
||||
setData(action, title, description, data = {}) {
|
||||
setData(action, title, description, showSuccess, data = {}) {
|
||||
this.id = getId(action)
|
||||
this.action = action
|
||||
this.data = { ...data }
|
||||
this.title = title
|
||||
this.description = description
|
||||
this.showSuccess = showSuccess
|
||||
this.startedAt = Date.now()
|
||||
}
|
||||
|
||||
|
@ -48,7 +51,10 @@ class Task {
|
|||
this.setFinished()
|
||||
}
|
||||
|
||||
setFinished() {
|
||||
setFinished(newDescription = null) {
|
||||
if (newDescription) {
|
||||
this.description = newDescription
|
||||
}
|
||||
this.isFinished = true
|
||||
this.finishedAt = Date.now()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue