mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Add server migrations
This commit is contained in:
parent
9c6ca37fc1
commit
d4c9f45b31
4 changed files with 105 additions and 3 deletions
|
@ -13,7 +13,7 @@ import {
|
|||
import { VideoChannelModel } from '../../models/video/video-channel'
|
||||
import { videoPlaylistsSortValidator } from '../../middlewares/validators'
|
||||
import { buildNSFWFilter, createReqFiles, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils'
|
||||
import { CONFIG, MIMETYPES, sequelizeTypescript, THUMBNAILS_SIZE } from '../../initializers'
|
||||
import { CONFIG, MIMETYPES, sequelizeTypescript, THUMBNAILS_SIZE, VIDEO_PLAYLIST_PRIVACIES } from '../../initializers'
|
||||
import { logger } from '../../helpers/logger'
|
||||
import { resetSequelizeInstance } from '../../helpers/database-utils'
|
||||
import { VideoPlaylistModel } from '../../models/video/video-playlist'
|
||||
|
@ -46,6 +46,8 @@ const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIM
|
|||
|
||||
const videoPlaylistRouter = express.Router()
|
||||
|
||||
videoPlaylistRouter.get('/privacies', listVideoPlaylistPrivacies)
|
||||
|
||||
videoPlaylistRouter.get('/',
|
||||
paginationValidator,
|
||||
videoPlaylistsSortValidator,
|
||||
|
@ -121,6 +123,10 @@ export {
|
|||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function listVideoPlaylistPrivacies (req: express.Request, res: express.Response) {
|
||||
res.json(VIDEO_PLAYLIST_PRIVACIES)
|
||||
}
|
||||
|
||||
async function listVideoPlaylists (req: express.Request, res: express.Response) {
|
||||
const serverActor = await getServerActor()
|
||||
const resultList = await VideoPlaylistModel.listForApi({
|
||||
|
@ -153,7 +159,7 @@ async function addVideoPlaylist (req: express.Request, res: express.Response) {
|
|||
|
||||
videoPlaylist.url = getVideoPlaylistActivityPubUrl(videoPlaylist) // We use the UUID, so set the URL after building the object
|
||||
|
||||
if (videoPlaylistInfo.videoChannelId !== undefined) {
|
||||
if (videoPlaylistInfo.videoChannelId) {
|
||||
const videoChannel = res.locals.videoChannel as VideoChannelModel
|
||||
|
||||
videoPlaylist.videoChannelId = videoChannel.id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue