]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/video-playlists.ts
Fix retrieving of deleted comments when subscribing to a new instance
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / video-playlists.ts
index c217a39bf9ed76d16ea52227784202e54f27213a..60125dcda6cf04e434e5d02e2bbe72ff64cc4c34 100644 (file)
@@ -1,6 +1,6 @@
 import { exists } from './misc'
 import * as validator from 'validator'
-import { CONSTRAINTS_FIELDS, VIDEO_PLAYLIST_PRIVACIES, VIDEO_PLAYLIST_TYPES } from '../../initializers'
+import { CONSTRAINTS_FIELDS, VIDEO_PLAYLIST_PRIVACIES, VIDEO_PLAYLIST_TYPES } from '../../initializers/constants'
 import * as express from 'express'
 import { VideoPlaylistModel } from '../../models/video/video-playlist'
 
@@ -26,25 +26,9 @@ function isVideoPlaylistTypeValid (value: any) {
   return exists(value) && VIDEO_PLAYLIST_TYPES[ value ] !== undefined
 }
 
-async function isVideoPlaylistExist (id: number | string, res: express.Response) {
-  const videoPlaylist = await VideoPlaylistModel.loadWithAccountAndChannel(id, undefined)
-
-  if (!videoPlaylist) {
-    res.status(404)
-       .json({ error: 'Video playlist not found' })
-       .end()
-
-    return false
-  }
-
-  res.locals.videoPlaylist = videoPlaylist
-  return true
-}
-
 // ---------------------------------------------------------------------------
 
 export {
-  isVideoPlaylistExist,
   isVideoPlaylistNameValid,
   isVideoPlaylistDescriptionValid,
   isVideoPlaylistPrivacyValid,