mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 01:35:08 +02:00
scanLibrary fail and cancel handling round 2
This commit is contained in:
parent
1099dbe642
commit
f8034e1b78
2 changed files with 36 additions and 39 deletions
|
@ -75,13 +75,14 @@ class LibraryScan {
|
|||
return date.format(new Date(), 'YYYY-MM-DD') + '_' + this.id + '.txt'
|
||||
}
|
||||
get scanResultsString() {
|
||||
if (this.error) return this.error
|
||||
const strs = []
|
||||
if (this.resultsAdded) strs.push(`${this.resultsAdded} added`)
|
||||
if (this.resultsUpdated) strs.push(`${this.resultsUpdated} updated`)
|
||||
if (this.resultsMissing) strs.push(`${this.resultsMissing} missing`)
|
||||
if (!strs.length) return `Everything was up to date (${elapsedPretty(this.elapsed / 1000)})`
|
||||
return strs.join(', ') + ` (${elapsedPretty(this.elapsed / 1000)})`
|
||||
const changesDetected = strs.length > 0 ? strs.join(', ') : 'No changes detected'
|
||||
const timeElapsed = `(${elapsedPretty(this.elapsed / 1000)})`
|
||||
const error = this.error ? `${this.error}. ` : ''
|
||||
return `${error}${changesDetected} ${timeElapsed}`
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue