X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fvideo-playlists.ts;h=180018fc54d68a9849f7e6caf080654204afd6e6;hb=b8598d40f650a31fe09a4a5426dcdc2c5c0d566c;hp=4bb8384ab1903a2bc2516ace6020dd90587a2f99;hpb=7cde3b9c2e84ea20bb0aae4544598483cde9e22c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/video-playlists.ts b/server/helpers/custom-validators/video-playlists.ts index 4bb8384ab..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 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 } // ---------------------------------------------------------------------------