]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/utils/videos/video-blacklist.ts
Add ability to limit videos history size
[github/Chocobozzz/PeerTube.git] / shared / utils / videos / video-blacklist.ts
index f2ae0ed26918ff5094c2b1d29f66373db4720bdf..82d5b7e318f9af38189fcd8c03a35cc8c93adb22 100644 (file)
@@ -51,6 +51,18 @@ function getBlacklistedVideosList (url: string, token: string, specialStatus = 2
           .expect('Content-Type', /json/)
 }
 
+function getBlacklistedVideosListWithTypeFilter (url: string, token: string, type: number, specialStatus = 200) {
+  const path = '/api/v1/videos/blacklist/'
+
+  return request(url)
+          .get(path)
+          .query({ sort: 'createdAt', type })
+          .set('Accept', 'application/json')
+          .set('Authorization', 'Bearer ' + token)
+          .expect(specialStatus)
+          .expect('Content-Type', /json/)
+}
+
 function getSortedBlacklistedVideosList (url: string, token: string, sort: string, specialStatus = 200) {
   const path = '/api/v1/videos/blacklist/'
 
@@ -69,6 +81,7 @@ export {
   addVideoToBlacklist,
   removeVideoFromBlacklist,
   getBlacklistedVideosList,
+  getBlacklistedVideosListWithTypeFilter,
   getSortedBlacklistedVideosList,
   updateVideoBlacklist
 }