+ const videoPlaylist = await VideoPlaylistModel.loadWithAccountAndChannelSummary(elementId, undefined)
+ if (!videoPlaylist) {
+ return res.status(HttpStatusCode.NOT_FOUND_404)
+ .json({ error: 'Video playlist not found' })
+ }
+
+ if (videoPlaylist.privacy !== VideoPlaylistPrivacy.PUBLIC) {
+ return res.status(HttpStatusCode.FORBIDDEN_403)
+ .json({ error: 'Playlist is not public' })
+ }
+
+ res.locals.videoPlaylistSummary = videoPlaylist