X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fvideo-playlists.ts;h=60125dcda6cf04e434e5d02e2bbe72ff64cc4c34;hb=3e753302d8c911b59971c16a8018df0e1ab78465;hp=2fe426560350683eb17a76f874a81cd084955aa9;hpb=a8b666e9f1ed002230869606308749614390c82f;p=github%2FChocobozzz%2FPeerTube.git 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) { return exists(value) && VIDEO_PLAYLIST_TYPES[ value ] !== undefined } -async function doesVideoPlaylistExist (id: number | string, res: express.Response, fetchType: 'summary' | 'all' = 'summary') { - const videoPlaylist = fetchType === 'summary' - ? await VideoPlaylistModel.loadWithAccountAndChannelSummary(id, undefined) - : 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 { - doesVideoPlaylistExist, isVideoPlaylistNameValid, isVideoPlaylistDescriptionValid, isVideoPlaylistPrivacyValid,