1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Add ability to list imports of a channel sync

This commit is contained in:
Chocobozzz 2022-08-10 11:51:13 +02:00
parent 0567049a98
commit a3b472a12e
No known key found for this signature in database
GPG key ID: 583A612D890159BE
37 changed files with 565 additions and 179 deletions

View file

@ -25,7 +25,13 @@ import {
usersUpdateMeValidator,
usersVideoRatingValidator
} from '../../../middlewares'
import { deleteMeValidator, usersVideosValidator, videoImportsSortValidator, videosSortValidator } from '../../../middlewares/validators'
import {
deleteMeValidator,
getMyVideoImportsValidator,
usersVideosValidator,
videoImportsSortValidator,
videosSortValidator
} from '../../../middlewares/validators'
import { updateAvatarValidator } from '../../../middlewares/validators/actor-image'
import { AccountModel } from '../../../models/account/account'
import { AccountVideoRateModel } from '../../../models/account/account-video-rate'
@ -60,6 +66,7 @@ meRouter.get('/me/videos/imports',
videoImportsSortValidator,
setDefaultSort,
setDefaultPagination,
getMyVideoImportsValidator,
asyncMiddleware(getUserVideoImports)
)
@ -138,7 +145,7 @@ async function getUserVideoImports (req: express.Request, res: express.Response)
const resultList = await VideoImportModel.listUserVideoImportsForApi({
userId: user.id,
...pick(req.query, [ 'targetUrl', 'start', 'count', 'sort' ])
...pick(req.query, [ 'targetUrl', 'start', 'count', 'sort', 'search', 'videoChannelSyncId' ])
})
return res.json(getFormattedObjects(resultList.data, resultList.total))