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:
parent
0567049a98
commit
a3b472a12e
37 changed files with 565 additions and 179 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue