mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-28 13:31:35 +00:00
Merge f819d661e8 into 47ea6b5092
This commit is contained in:
commit
bd2c33595d
2 changed files with 60 additions and 18 deletions
|
|
@ -123,11 +123,7 @@ class LibraryScan {
|
|||
}
|
||||
|
||||
async saveLog() {
|
||||
const scanLogDir = Path.join(global.MetadataPath, 'logs', 'scans')
|
||||
|
||||
if (!(await fs.pathExists(scanLogDir))) {
|
||||
await fs.mkdir(scanLogDir)
|
||||
}
|
||||
const scanLogDir = Logger.logManager.ScanLogPath
|
||||
|
||||
const outputPath = Path.join(scanLogDir, this.logFilename)
|
||||
const logLines = [JSON.stringify(this.toJSON())]
|
||||
|
|
@ -137,6 +133,8 @@ class LibraryScan {
|
|||
await fs.writeFile(outputPath, logLines.join('\n') + '\n')
|
||||
|
||||
Logger.info(`[LibraryScan] Scan log saved "${outputPath}"`)
|
||||
|
||||
await Logger.logManager?.purgeOldScanLogs()
|
||||
}
|
||||
}
|
||||
module.exports = LibraryScan
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue