aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/video-playlists.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators/video-playlists.ts')
-rw-r--r--server/helpers/custom-validators/video-playlists.ts18
1 files changed, 0 insertions, 18 deletions
diff --git a/server/helpers/custom-validators/video-playlists.ts b/server/helpers/custom-validators/video-playlists.ts
index 2fe426560..60125dcda 100644
--- a/server/helpers/custom-validators/video-playlists.ts
+++ b/server/helpers/custom-validators/video-playlists.ts
@@ -26,27 +26,9 @@ function isVideoPlaylistTypeValid (value: any) {
26 return exists(value) && VIDEO_PLAYLIST_TYPES[ value ] !== undefined 26 return exists(value) && VIDEO_PLAYLIST_TYPES[ value ] !== undefined
27} 27}
28 28
29async function doesVideoPlaylistExist (id: number | string, res: express.Response, fetchType: 'summary' | 'all' = 'summary') {
30 const videoPlaylist = fetchType === 'summary'
31 ? await VideoPlaylistModel.loadWithAccountAndChannelSummary(id, undefined)
32 : await VideoPlaylistModel.loadWithAccountAndChannel(id, undefined)
33
34 if (!videoPlaylist) {
35 res.status(404)
36 .json({ error: 'Video playlist not found' })
37 .end()
38
39 return false
40 }
41
42 res.locals.videoPlaylist = videoPlaylist
43 return true
44}
45
46// --------------------------------------------------------------------------- 29// ---------------------------------------------------------------------------
47 30
48export { 31export {
49 doesVideoPlaylistExist,
50 isVideoPlaylistNameValid, 32 isVideoPlaylistNameValid,
51 isVideoPlaylistDescriptionValid, 33 isVideoPlaylistDescriptionValid,
52 isVideoPlaylistPrivacyValid, 34 isVideoPlaylistPrivacyValid,