+ expect(playlist.ownerAccount.name).to.equal('root')
+ expect(playlist.ownerAccount.displayName).to.equal('root')
+ expect(playlist.videoChannel.name).to.equal('root_channel')
+ expect(playlist.videoChannel.displayName).to.equal('Main root channel')
+ }
+ }
+ })
+
+ it('Should create a playlist on server 2 and have the playlist on server 1 but not on server 3', async function () {
+ this.timeout(30000)
+
+ {
+ const res = await createVideoPlaylist({
+ url: servers[1].url,
+ token: servers[1].accessToken,
+ playlistAttrs: {
+ displayName: 'playlist 2',
+ privacy: VideoPlaylistPrivacy.PUBLIC,
+ videoChannelId: servers[1].videoChannel.id
+ }
+ })
+ playlistServer2Id1 = res.body.videoPlaylist.id
+ }
+
+ {
+ const res = await createVideoPlaylist({
+ url: servers[1].url,
+ token: servers[1].accessToken,
+ playlistAttrs: {
+ displayName: 'playlist 3',
+ privacy: VideoPlaylistPrivacy.PUBLIC,
+ thumbnailfile: 'thumbnail.jpg',
+ videoChannelId: servers[1].videoChannel.id
+ }
+ })
+
+ playlistServer2Id2 = res.body.videoPlaylist.id
+ playlistServer2UUID2 = res.body.videoPlaylist.uuid
+ }
+
+ for (const id of [ playlistServer2Id1, playlistServer2Id2 ]) {
+ await addVideoInPlaylist({
+ url: servers[1].url,
+ token: servers[1].accessToken,
+ playlistId: id,
+ elementAttrs: { videoId: servers[1].videos[0].id, startTimestamp: 1, stopTimestamp: 2 }
+ })
+ await addVideoInPlaylist({
+ url: servers[1].url,
+ token: servers[1].accessToken,
+ playlistId: id,
+ elementAttrs: { videoId: servers[1].videos[1].id }
+ })
+ }
+
+ await waitJobs(servers)
+ await wait(3000)
+
+ for (const server of [ servers[0], servers[1] ]) {
+ const res = await getVideoPlaylistsList(server.url, 0, 5)
+
+ const playlist2 = res.body.data.find(p => p.displayName === 'playlist 2')
+ expect(playlist2).to.not.be.undefined
+ await testImage(server.url, 'thumbnail-playlist', playlist2.thumbnailPath)
+
+ const playlist3 = res.body.data.find(p => p.displayName === 'playlist 3')
+ expect(playlist3).to.not.be.undefined
+ await testImage(server.url, 'thumbnail', playlist3.thumbnailPath)
+ }
+
+ const res = await getVideoPlaylistsList(servers[2].url, 0, 5)
+ expect(res.body.data.find(p => p.displayName === 'playlist 2')).to.be.undefined
+ expect(res.body.data.find(p => p.displayName === 'playlist 3')).to.be.undefined
+ })