aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/activitypub/playlist.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/activitypub/playlist.ts b/server/helpers/custom-validators/activitypub/playlist.ts
index bd0d16a4a..72c5b80e9 100644
--- a/server/helpers/custom-validators/activitypub/playlist.ts
+++ b/server/helpers/custom-validators/activitypub/playlist.ts
@@ -1,13 +1,16 @@
1import { exists, isDateValid } from '../misc'
2import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object'
3import validator from 'validator' 1import validator from 'validator'
4import { PlaylistElementObject } from '../../../../shared/models/activitypub/objects/playlist-element-object' 2import { PlaylistElementObject } from '../../../../shared/models/activitypub/objects/playlist-element-object'
3import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object'
4import { exists, isDateValid, isUUIDValid } from '../misc'
5import { isVideoPlaylistNameValid } from '../video-playlists'
5import { isActivityPubUrlValid } from './misc' 6import { isActivityPubUrlValid } from './misc'
6 7
7function isPlaylistObjectValid (object: PlaylistObject) { 8function isPlaylistObjectValid (object: PlaylistObject) {
8 return exists(object) && 9 return exists(object) &&
9 object.type === 'Playlist' && 10 object.type === 'Playlist' &&
10 validator.isInt(object.totalItems + '') && 11 validator.isInt(object.totalItems + '') &&
12 isVideoPlaylistNameValid(object.name) &&
13 isUUIDValid(object.uuid) &&
11 isDateValid(object.published) && 14 isDateValid(object.published) &&
12 isDateValid(object.updated) 15 isDateValid(object.updated)
13} 16}