]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/collection.ts
Refactor playlist creation for lives
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / collection.ts
index 43a704aa4f3b0c9b59c139670199e2f22d4c7cc7..a176cab51ab880bf24212385cdeb6dbd8ed90a43 100644 (file)
@@ -3,6 +3,7 @@ import validator from 'validator'
 import { pageToStartAndCount } from '@server/helpers/core-utils'
 import { ACTIVITY_PUB } from '@server/initializers/constants'
 import { ResultList } from '@shared/models'
+import { forceNumber } from '@shared/core-utils'
 
 type ActivityPubCollectionPaginationHandler = (start: number, count: number) => Bluebird<ResultList<any>> | Promise<ResultList<any>>
 
@@ -18,7 +19,7 @@ async function activityPubCollectionPagination (
 
     return {
       id: baseUrl,
-      type: 'OrderedCollectionPage',
+      type: 'OrderedCollection',
       totalItems: result.total,
       first: result.data.length === 0
         ? undefined
@@ -33,7 +34,7 @@ async function activityPubCollectionPagination (
   let prev: string | undefined
 
   // Assert page is a number
-  page = parseInt(page, 10)
+  page = forceNumber(page)
 
   // There are more results
   if (result.total > page * size) {