]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/video-playlist.ts
Add AP stats
[github/Chocobozzz/PeerTube.git] / server / controllers / api / video-playlist.ts
index fb08a63b213fbf30d43e2f951057f62b039c32af..f3dc8b2a98d3ebb03a6ca785da0a8c8964dd3076 100644 (file)
@@ -42,6 +42,7 @@ import {
 import { AccountModel } from '../../models/account/account'
 import { VideoPlaylistModel } from '../../models/video/video-playlist'
 import { VideoPlaylistElementModel } from '../../models/video/video-playlist-element'
+import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
 
 const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { thumbnailfile: CONFIG.STORAGE.TMP_DIR })
 
@@ -271,7 +272,7 @@ async function updateVideoPlaylist (req: express.Request, res: express.Response)
     throw err
   }
 
-  return res.type('json').status(204).end()
+  return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end()
 }
 
 async function removeVideoPlaylist (req: express.Request, res: express.Response) {
@@ -285,7 +286,7 @@ async function removeVideoPlaylist (req: express.Request, res: express.Response)
     logger.info('Video playlist %s deleted.', videoPlaylistInstance.uuid)
   })
 
-  return res.type('json').status(204).end()
+  return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end()
 }
 
 async function addVideoInPlaylist (req: express.Request, res: express.Response) {
@@ -351,7 +352,7 @@ async function updateVideoPlaylistElement (req: express.Request, res: express.Re
 
   logger.info('Element of position %d of playlist %s updated.', playlistElement.position, videoPlaylist.uuid)
 
-  return res.type('json').status(204).end()
+  return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end()
 }
 
 async function removeVideoFromPlaylist (req: express.Request, res: express.Response) {
@@ -379,7 +380,7 @@ async function removeVideoFromPlaylist (req: express.Request, res: express.Respo
   sendUpdateVideoPlaylist(videoPlaylist, undefined)
     .catch(err => logger.error('Cannot send video playlist update.', { err }))
 
-  return res.type('json').status(204).end()
+  return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end()
 }
 
 async function reorderVideosPlaylist (req: express.Request, res: express.Response) {
@@ -391,7 +392,7 @@ async function reorderVideosPlaylist (req: express.Request, res: express.Respons
   const reorderLength: number = body.reorderLength || 1
 
   if (start === insertAfter) {
-    return res.status(204).end()
+    return res.status(HttpStatusCode.NO_CONTENT_204).end()
   }
 
   // Example: if we reorder position 2 and insert after position 5 (so at position 6): # 1 2 3 4 5 6 7 8 9
@@ -432,7 +433,7 @@ async function reorderVideosPlaylist (req: express.Request, res: express.Respons
     videoPlaylist.uuid, insertAfter, start, start + reorderLength - 1
   )
 
-  return res.type('json').status(204).end()
+  return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end()
 }
 
 async function getVideoPlaylistVideos (req: express.Request, res: express.Response) {