diff options
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r-- | server/controllers/api/video-channel.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index 534cc8d7b..c13aed4dc 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts | |||
@@ -33,6 +33,7 @@ import { resetSequelizeInstance } from '../../helpers/database-utils' | |||
33 | import { UserModel } from '../../models/account/user' | 33 | import { UserModel } from '../../models/account/user' |
34 | import { JobQueue } from '../../lib/job-queue' | 34 | import { JobQueue } from '../../lib/job-queue' |
35 | import { VideoPlaylistModel } from '../../models/video/video-playlist' | 35 | import { VideoPlaylistModel } from '../../models/video/video-playlist' |
36 | import { commonVideoPlaylistFiltersValidator } from '../../middlewares/validators/videos/video-playlists' | ||
36 | 37 | ||
37 | const auditLogger = auditLoggerFactory('channels') | 38 | const auditLogger = auditLoggerFactory('channels') |
38 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) | 39 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) |
@@ -85,6 +86,7 @@ videoChannelRouter.get('/:nameWithHost/video-playlists', | |||
85 | videoPlaylistsSortValidator, | 86 | videoPlaylistsSortValidator, |
86 | setDefaultSort, | 87 | setDefaultSort, |
87 | setDefaultPagination, | 88 | setDefaultPagination, |
89 | commonVideoPlaylistFiltersValidator, | ||
88 | asyncMiddleware(listVideoChannelPlaylists) | 90 | asyncMiddleware(listVideoChannelPlaylists) |
89 | ) | 91 | ) |
90 | 92 | ||
@@ -197,6 +199,8 @@ async function removeVideoChannel (req: express.Request, res: express.Response) | |||
197 | const videoChannelInstance: VideoChannelModel = res.locals.videoChannel | 199 | const videoChannelInstance: VideoChannelModel = res.locals.videoChannel |
198 | 200 | ||
199 | await sequelizeTypescript.transaction(async t => { | 201 | await sequelizeTypescript.transaction(async t => { |
202 | await VideoPlaylistModel.resetPlaylistsOfChannel(videoChannelInstance.id, t) | ||
203 | |||
200 | await videoChannelInstance.destroy({ transaction: t }) | 204 | await videoChannelInstance.destroy({ transaction: t }) |
201 | 205 | ||
202 | auditLogger.delete(getAuditIdFromRes(res), new VideoChannelAuditView(videoChannelInstance.toFormattedJSON())) | 206 | auditLogger.delete(getAuditIdFromRes(res), new VideoChannelAuditView(videoChannelInstance.toFormattedJSON())) |
@@ -225,7 +229,8 @@ async function listVideoChannelPlaylists (req: express.Request, res: express.Res | |||
225 | start: req.query.start, | 229 | start: req.query.start, |
226 | count: req.query.count, | 230 | count: req.query.count, |
227 | sort: req.query.sort, | 231 | sort: req.query.sort, |
228 | videoChannelId: res.locals.videoChannel.id | 232 | videoChannelId: res.locals.videoChannel.id, |
233 | type: req.query.playlistType | ||
229 | }) | 234 | }) |
230 | 235 | ||
231 | return res.json(getFormattedObjects(resultList.data, resultList.total)) | 236 | return res.json(getFormattedObjects(resultList.data, resultList.total)) |