-async function isVideoPlaylistExist (id: number | string, res: express.Response) {
- const videoPlaylist = await VideoPlaylistModel.load(id, undefined)
+function isVideoPlaylistTimestampValid (value: any) {
+ return value === null || (exists(value) && validator.isInt('' + value, { min: 0 }))
+}
+
+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)