mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-27 06:09:38 +00:00
Update Task object to handle translation keys with subs
This commit is contained in:
parent
bb481ccfb4
commit
8512d5e693
8 changed files with 220 additions and 54 deletions
|
|
@ -76,7 +76,12 @@ class LibraryScanner {
|
|||
libraryName: library.name,
|
||||
libraryMediaType: library.mediaType
|
||||
}
|
||||
const task = TaskManager.createAndAddTask('library-scan', `Scanning "${library.name}" library`, null, true, taskData)
|
||||
const taskTitleString = {
|
||||
text: `Scanning "${library.name}" library`,
|
||||
key: 'MessageTaskScanningLibrary',
|
||||
subs: [library.name]
|
||||
}
|
||||
const task = TaskManager.createAndAddTask('library-scan', taskTitleString, null, true, taskData)
|
||||
|
||||
Logger.info(`[LibraryScanner] Starting${forceRescan ? ' (forced)' : ''} library scan ${libraryScan.id} for ${libraryScan.libraryName}`)
|
||||
|
||||
|
|
@ -104,7 +109,7 @@ class LibraryScanner {
|
|||
|
||||
Logger.error(`[LibraryScanner] Library scan ${libraryScan.id} failed after ${libraryScan.elapsedTimestamp} | ${libraryScan.resultStats}.`, err)
|
||||
|
||||
task.setFailed(`Failed. ${libraryScan.scanResultsString}`)
|
||||
task.setFailedText(`Failed. ${libraryScan.scanResultsString}`)
|
||||
}
|
||||
|
||||
if (this.cancelLibraryScan[libraryScan.libraryId]) delete this.cancelLibraryScan[libraryScan.libraryId]
|
||||
|
|
|
|||
|
|
@ -368,7 +368,12 @@ class Scanner {
|
|||
const taskData = {
|
||||
libraryId: library.id
|
||||
}
|
||||
const task = TaskManager.createAndAddTask('library-match-all', `Matching books in "${library.name}"`, null, true, taskData)
|
||||
const taskTitleString = {
|
||||
text: `Matching books in "${library.name}"`,
|
||||
key: 'MessageTaskMatchingBooksInLibrary',
|
||||
subs: [library.name]
|
||||
}
|
||||
const task = TaskManager.createAndAddTask('library-match-all', taskTitleString, null, true, taskData)
|
||||
Logger.info(`[Scanner] matchLibraryItems: Starting library match scan ${libraryScan.id} for ${libraryScan.libraryName}`)
|
||||
|
||||
let hasMoreChunks = true
|
||||
|
|
@ -393,7 +398,7 @@ class Scanner {
|
|||
if (offset === 0) {
|
||||
Logger.error(`[Scanner] matchLibraryItems: Library has no items ${library.id}`)
|
||||
libraryScan.setComplete('Library has no items')
|
||||
task.setFailed(libraryScan.error)
|
||||
task.setFailedText(libraryScan.error)
|
||||
} else {
|
||||
libraryScan.setComplete()
|
||||
task.setFinished(isCanceled ? 'Canceled' : libraryScan.scanResultsString)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue