X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fvideo-playlists.ts;h=180018fc54d68a9849f7e6caf080654204afd6e6;hb=dc48fdbe68e9dd3a3a6028181e61d8595d98e654;hp=60125dcda6cf04e434e5d02e2bbe72ff64cc4c34;hpb=3e753302d8c911b59971c16a8018df0e1ab78465;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/video-playlists.ts b/server/helpers/custom-validators/video-playlists.ts index 60125dcda..180018fc5 100644 --- a/server/helpers/custom-validators/video-playlists.ts +++ b/server/helpers/custom-validators/video-playlists.ts @@ -1,8 +1,6 @@ import { exists } from './misc' -import * as validator from 'validator' +import validator from 'validator' import { CONSTRAINTS_FIELDS, VIDEO_PLAYLIST_PRIVACIES, VIDEO_PLAYLIST_TYPES } from '../../initializers/constants' -import * as express from 'express' -import { VideoPlaylistModel } from '../../models/video/video-playlist' const PLAYLISTS_CONSTRAINT_FIELDS = CONSTRAINTS_FIELDS.VIDEO_PLAYLISTS @@ -15,7 +13,7 @@ function isVideoPlaylistDescriptionValid (value: any) { } function isVideoPlaylistPrivacyValid (value: number) { - return validator.isInt(value + '') && VIDEO_PLAYLIST_PRIVACIES[ value ] !== undefined + return validator.isInt(value + '') && VIDEO_PLAYLIST_PRIVACIES[value] !== undefined } function isVideoPlaylistTimestampValid (value: any) { @@ -23,7 +21,7 @@ function isVideoPlaylistTimestampValid (value: any) { } function isVideoPlaylistTypeValid (value: any) { - return exists(value) && VIDEO_PLAYLIST_TYPES[ value ] !== undefined + return exists(value) && VIDEO_PLAYLIST_TYPES[value] !== undefined } // ---------------------------------------------------------------------------