mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Add banners support
This commit is contained in:
parent
f479685678
commit
2cb03dc1f4
33 changed files with 392 additions and 240 deletions
|
@ -1,5 +1,8 @@
|
|||
import 'multer'
|
||||
import * as express from 'express'
|
||||
import { sendUndoFollow } from '@server/lib/activitypub/send'
|
||||
import { VideoChannelModel } from '@server/models/video/video-channel'
|
||||
import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
|
||||
import { VideoFilter } from '../../../../shared/models/videos/video-query.type'
|
||||
import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils'
|
||||
import { getFormattedObjects } from '../../../helpers/utils'
|
||||
|
@ -26,8 +29,6 @@ import {
|
|||
} from '../../../middlewares/validators'
|
||||
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
||||
import { VideoModel } from '../../../models/video/video'
|
||||
import { sendUndoFollow } from '@server/lib/activitypub/send'
|
||||
import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
|
||||
|
||||
const mySubscriptionsRouter = express.Router()
|
||||
|
||||
|
@ -66,7 +67,7 @@ mySubscriptionsRouter.post('/me/subscriptions',
|
|||
mySubscriptionsRouter.get('/me/subscriptions/:uri',
|
||||
authenticate,
|
||||
userSubscriptionGetValidator,
|
||||
getUserSubscription
|
||||
asyncMiddleware(getUserSubscription)
|
||||
)
|
||||
|
||||
mySubscriptionsRouter.delete('/me/subscriptions/:uri',
|
||||
|
@ -130,10 +131,11 @@ function addUserSubscription (req: express.Request, res: express.Response) {
|
|||
return res.status(HttpStatusCode.NO_CONTENT_204).end()
|
||||
}
|
||||
|
||||
function getUserSubscription (req: express.Request, res: express.Response) {
|
||||
async function getUserSubscription (req: express.Request, res: express.Response) {
|
||||
const subscription = res.locals.subscription
|
||||
const videoChannel = await VideoChannelModel.loadAndPopulateAccount(subscription.ActorFollowing.VideoChannel.id)
|
||||
|
||||
return res.json(subscription.ActorFollowing.VideoChannel.toFormattedJSON())
|
||||
return res.json(videoChannel.toFormattedJSON())
|
||||
}
|
||||
|
||||
async function deleteUserSubscription (req: express.Request, res: express.Response) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue