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
|
|
@ -6,7 +6,7 @@ const date = require('../libs/dateAndTime')
|
|||
const Logger = require('../Logger')
|
||||
const Library = require('../objects/Library')
|
||||
const { LogLevel } = require('../utils/constants')
|
||||
const { secondsToTimestamp } = require('../utils/index')
|
||||
const { secondsToTimestamp, elapsedPretty } = require('../utils/index')
|
||||
|
||||
class LibraryScan {
|
||||
constructor() {
|
||||
|
|
@ -67,6 +67,15 @@ class LibraryScan {
|
|||
get logFilename() {
|
||||
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)})`
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue