New data model save covers, scanner, new api routes

This commit is contained in:
advplyr 2022-03-12 17:45:32 -06:00
parent 5f4e5cd3d8
commit 73257188f6
37 changed files with 1649 additions and 672 deletions

View file

@ -42,11 +42,11 @@ class CacheManager {
readStream.pipe(res)
}
async purgeCoverCache(audiobookId) {
async purgeCoverCache(libraryItemId) {
// If purgeAll has been called... The cover cache directory no longer exists
await fs.ensureDir(this.CoverCachePath)
return Promise.all((await fs.readdir(this.CoverCachePath)).reduce((promises, file) => {
if (file.startsWith(audiobookId)) {
if (file.startsWith(libraryItemId)) {
Logger.debug(`[CacheManager] Going to purge ${file}`);
promises.push(this.removeCache(Path.join(this.CoverCachePath, file)))
}