Optimize SQL requests of watch page API endpoints

This commit is contained in:
Chocobozzz 2018-09-18 12:00:49 +02:00
parent e972e046db
commit 627621c1e8
No known key found for this signature in database
GPG key ID: 583A612D890159BE
15 changed files with 68 additions and 60 deletions

View file

@ -56,7 +56,7 @@ async function pruneDirectory (directory: string) {
const uuid = getUUIDFromFilename(file)
let video: VideoModel
if (uuid) video = await VideoModel.loadByUUID(uuid)
if (uuid) video = await VideoModel.loadByUUIDWithFile(uuid)
if (!uuid || !video) toDelete.push(join(directory, file))
}