X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-import.ts;h=1d82960609904c3c872da37bdf1fafa494d96eb3;hb=a2fb5fb8b1007e3ce82e707917f5d9a37374e99b;hp=c5c1a10f49379a9a1717e33c2c5345311e5579eb;hpb=d17c7b4e8c52317bdc874917387b7a49f6cf8b01;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-import.ts b/server/models/video/video-import.ts index c5c1a10f4..1d8296060 100644 --- a/server/models/video/video-import.ts +++ b/server/models/video/video-import.ts @@ -1,3 +1,4 @@ +import { WhereOptions } from 'sequelize' import { AfterUpdate, AllowNull, @@ -125,7 +126,20 @@ export class VideoImportModel extends Model(query) - .then(({ rows, count }) => { - return { - data: rows, - total: count - } - }) + return Promise.all([ + VideoImportModel.unscoped().count(query), + VideoImportModel.findAll(query) + ]).then(([ total, data ]) => ({ total, data })) } getTargetIdentifier () {