From 38a3ccc7f8ad0ea94362b58c732af7c387ab46be Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Mon, 24 Oct 2022 14:48:03 +0200 Subject: feat: show contained playlists under My videos (#5125) * feat: show contained playlists under My videos closes #4769 * refactor(server): remove unused types * fixes after code review * fix(client/video-miniature): add to playlist * fix(server/user/me): shortUUID response * Revert "fix(client/video-miniature): add to playlist" This reverts commit f1a0412391c7e2370b87df2594c9fe3f39a40ddc. * fix(client/PlaylistService): caching * Revert "fix(server/user/me): shortUUID response" This reverts commit e3f1ee4e335739b895bced938540c003df24af73. * Fix fetching playlists Co-authored-by: Chocobozzz --- server/tests/api/videos/video-playlists.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'server/tests/api/videos') diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts index 9d223de48..a3de73ba5 100644 --- a/server/tests/api/videos/video-playlists.ts +++ b/server/tests/api/videos/video-playlists.ts @@ -23,6 +23,7 @@ import { setDefaultVideoChannel, waitJobs } from '@shared/server-commands' +import { uuidToShort } from '@shared/extra-utils' async function checkPlaylistElementType ( servers: PeerTubeServer[], @@ -56,6 +57,7 @@ describe('Test video playlists', function () { let playlistServer2UUID2: string let playlistServer1Id: number + let playlistServer1DisplayName: string let playlistServer1UUID: string let playlistServer1UUID2: string @@ -489,15 +491,17 @@ describe('Test video playlists', function () { return commands[0].addElement({ playlistId: playlistServer1Id, attributes }) } + const playlistDisplayName = 'playlist 4' const playlist = await commands[0].create({ attributes: { - displayName: 'playlist 4', + displayName: playlistDisplayName, privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[0].store.channel.id } }) playlistServer1Id = playlist.id + playlistServer1DisplayName = playlistDisplayName playlistServer1UUID = playlist.uuid await addVideo({ videoId: servers[0].store.videos[0].uuid, startTimestamp: 15, stopTimestamp: 28 }) @@ -908,6 +912,8 @@ describe('Test video playlists', function () { const elem = obj[servers[0].store.videos[0].id] expect(elem).to.have.lengthOf(1) expect(elem[0].playlistElementId).to.exist + expect(elem[0].playlistDisplayName).to.equal(playlistServer1DisplayName) + expect(elem[0].playlistShortUUID).to.equal(uuidToShort(playlistServer1UUID)) expect(elem[0].playlistId).to.equal(playlistServer1Id) expect(elem[0].startTimestamp).to.equal(15) expect(elem[0].stopTimestamp).to.equal(28) @@ -917,6 +923,8 @@ describe('Test video playlists', function () { const elem = obj[servers[0].store.videos[3].id] expect(elem).to.have.lengthOf(1) expect(elem[0].playlistElementId).to.equal(playlistElementServer1Video4) + expect(elem[0].playlistDisplayName).to.equal(playlistServer1DisplayName) + expect(elem[0].playlistShortUUID).to.equal(uuidToShort(playlistServer1UUID)) expect(elem[0].playlistId).to.equal(playlistServer1Id) expect(elem[0].startTimestamp).to.equal(1) expect(elem[0].stopTimestamp).to.equal(35) @@ -926,6 +934,8 @@ describe('Test video playlists', function () { const elem = obj[servers[0].store.videos[4].id] expect(elem).to.have.lengthOf(1) expect(elem[0].playlistId).to.equal(playlistServer1Id) + expect(elem[0].playlistDisplayName).to.equal(playlistServer1DisplayName) + expect(elem[0].playlistShortUUID).to.equal(uuidToShort(playlistServer1UUID)) expect(elem[0].startTimestamp).to.equal(45) expect(elem[0].stopTimestamp).to.equal(null) } -- cgit v1.2.3