]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/channel-import-videos.ts
Merge branch 'release/4.3.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / channel-import-videos.ts
index 7cfd02fbb4855319ac55c720797cc7f8a11bda34..a66f88a0ec13f3777334f63c64d89322b32a6b51 100644 (file)
@@ -109,6 +109,45 @@ describe('Test videos import in a channel', function () {
         }
       })
 
+      it('Should limit max amount of videos synced on full sync', async function () {
+        this.timeout(240_000)
+
+        await server.kill()
+        await server.run({
+          import: {
+            video_channel_synchronization: {
+              full_sync_videos_limit: 1
+            }
+          }
+        })
+
+        const { id } = await server.channels.create({ attributes: { name: 'channel3' } })
+        const channel3Id = id
+
+        const { videoChannelSync } = await server.channelSyncs.create({
+          attributes: {
+            externalChannelUrl: FIXTURE_URLS.youtubeChannel,
+            videoChannelId: channel3Id
+          }
+        })
+        const syncId = videoChannelSync.id
+
+        await waitJobs(server)
+
+        await server.channels.importVideos({
+          channelName: 'channel3',
+          externalChannelUrl: FIXTURE_URLS.youtubeChannel,
+          videoChannelSyncId: syncId
+        })
+
+        await waitJobs(server)
+
+        const { total, data } = await server.videos.listByChannel({ handle: 'channel3' })
+
+        expect(total).to.equal(1)
+        expect(data).to.have.lengthOf(1)
+      })
+
       after(async function () {
         await server?.kill()
       })
@@ -116,5 +155,7 @@ describe('Test videos import in a channel', function () {
   }
 
   runSuite('yt-dlp')
-  runSuite('youtube-dl')
+
+  // FIXME: With recent changes on youtube, youtube-dl doesn't fetch live replays which means the test suite fails
+  // runSuite('youtube-dl')
 })