+async function accountPlaylistsController (req: express.Request, res: express.Response) {
+ const account = res.locals.account
+ const activityPubResult = await actorPlaylists(req, { account })
+
+ return activityPubResponse(activityPubContextify(activityPubResult), res)
+}
+
+async function videoChannelPlaylistsController (req: express.Request, res: express.Response) {
+ const channel = res.locals.videoChannel
+ const activityPubResult = await actorPlaylists(req, { channel })
+
+ return activityPubResponse(activityPubContextify(activityPubResult), res)
+}
+
+function getAccountVideoRateFactory (rateType: VideoRateType) {
+ return (req: express.Request, res: express.Response) => {
+ const accountVideoRate = res.locals.accountVideoRate
+
+ const byActor = accountVideoRate.Account.Actor
+ const APObject = rateType === 'like'
+ ? buildLikeActivity(accountVideoRate.url, byActor, accountVideoRate.Video)
+ : buildDislikeActivity(accountVideoRate.url, byActor, accountVideoRate.Video)
+
+ return activityPubResponse(activityPubContextify(APObject), res)
+ }
+}
+
+async function videoController (req: express.Request, res: express.Response) {
+ // We need more attributes
+ const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(res.locals.onlyVideoWithRights.id)
+
+ if (redirectIfNotOwned(video.url, res)) return