diff options
Diffstat (limited to 'server/tests/api/videos/video-playlist-thumbnails.ts')
-rw-r--r-- | server/tests/api/videos/video-playlist-thumbnails.ts | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/server/tests/api/videos/video-playlist-thumbnails.ts b/server/tests/api/videos/video-playlist-thumbnails.ts index 14739af20..709f64c4d 100644 --- a/server/tests/api/videos/video-playlist-thumbnails.ts +++ b/server/tests/api/videos/video-playlist-thumbnails.ts | |||
@@ -31,13 +31,13 @@ describe('Playlist thumbnail', function () { | |||
31 | let video2: number | 31 | let video2: number |
32 | 32 | ||
33 | async function getPlaylistWithoutThumbnail (server: ServerInfo) { | 33 | async function getPlaylistWithoutThumbnail (server: ServerInfo) { |
34 | const body = await server.playlistsCommand.list({ start: 0, count: 10 }) | 34 | const body = await server.playlists.list({ start: 0, count: 10 }) |
35 | 35 | ||
36 | return body.data.find(p => p.displayName === 'playlist without thumbnail') | 36 | return body.data.find(p => p.displayName === 'playlist without thumbnail') |
37 | } | 37 | } |
38 | 38 | ||
39 | async function getPlaylistWithThumbnail (server: ServerInfo) { | 39 | async function getPlaylistWithThumbnail (server: ServerInfo) { |
40 | const body = await server.playlistsCommand.list({ start: 0, count: 10 }) | 40 | const body = await server.playlists.list({ start: 0, count: 10 }) |
41 | 41 | ||
42 | return body.data.find(p => p.displayName === 'playlist with thumbnail') | 42 | return body.data.find(p => p.displayName === 'playlist with thumbnail') |
43 | } | 43 | } |
@@ -54,8 +54,8 @@ describe('Playlist thumbnail', function () { | |||
54 | // Server 1 and server 2 follow each other | 54 | // Server 1 and server 2 follow each other |
55 | await doubleFollow(servers[0], servers[1]) | 55 | await doubleFollow(servers[0], servers[1]) |
56 | 56 | ||
57 | video1 = (await servers[0].videosCommand.quickUpload({ name: 'video 1' })).id | 57 | video1 = (await servers[0].videos.quickUpload({ name: 'video 1' })).id |
58 | video2 = (await servers[0].videosCommand.quickUpload({ name: 'video 2' })).id | 58 | video2 = (await servers[0].videos.quickUpload({ name: 'video 2' })).id |
59 | 59 | ||
60 | await waitJobs(servers) | 60 | await waitJobs(servers) |
61 | }) | 61 | }) |
@@ -63,16 +63,16 @@ describe('Playlist thumbnail', function () { | |||
63 | it('Should automatically update the thumbnail when adding an element', async function () { | 63 | it('Should automatically update the thumbnail when adding an element', async function () { |
64 | this.timeout(30000) | 64 | this.timeout(30000) |
65 | 65 | ||
66 | const created = await servers[1].playlistsCommand.create({ | 66 | const created = await servers[1].playlists.create({ |
67 | attributes: { | 67 | attributes: { |
68 | displayName: 'playlist without thumbnail', | 68 | displayName: 'playlist without thumbnail', |
69 | privacy: VideoPlaylistPrivacy.PUBLIC, | 69 | privacy: VideoPlaylistPrivacy.PUBLIC, |
70 | videoChannelId: servers[1].videoChannel.id | 70 | videoChannelId: servers[1].store.channel.id |
71 | } | 71 | } |
72 | }) | 72 | }) |
73 | playlistWithoutThumbnailId = created.id | 73 | playlistWithoutThumbnailId = created.id |
74 | 74 | ||
75 | const added = await servers[1].playlistsCommand.addElement({ | 75 | const added = await servers[1].playlists.addElement({ |
76 | playlistId: playlistWithoutThumbnailId, | 76 | playlistId: playlistWithoutThumbnailId, |
77 | attributes: { videoId: video1 } | 77 | attributes: { videoId: video1 } |
78 | }) | 78 | }) |
@@ -89,17 +89,17 @@ describe('Playlist thumbnail', function () { | |||
89 | it('Should not update the thumbnail if we explicitly uploaded a thumbnail', async function () { | 89 | it('Should not update the thumbnail if we explicitly uploaded a thumbnail', async function () { |
90 | this.timeout(30000) | 90 | this.timeout(30000) |
91 | 91 | ||
92 | const created = await servers[1].playlistsCommand.create({ | 92 | const created = await servers[1].playlists.create({ |
93 | attributes: { | 93 | attributes: { |
94 | displayName: 'playlist with thumbnail', | 94 | displayName: 'playlist with thumbnail', |
95 | privacy: VideoPlaylistPrivacy.PUBLIC, | 95 | privacy: VideoPlaylistPrivacy.PUBLIC, |
96 | videoChannelId: servers[1].videoChannel.id, | 96 | videoChannelId: servers[1].store.channel.id, |
97 | thumbnailfile: 'thumbnail.jpg' | 97 | thumbnailfile: 'thumbnail.jpg' |
98 | } | 98 | } |
99 | }) | 99 | }) |
100 | playlistWithThumbnailId = created.id | 100 | playlistWithThumbnailId = created.id |
101 | 101 | ||
102 | const added = await servers[1].playlistsCommand.addElement({ | 102 | const added = await servers[1].playlists.addElement({ |
103 | playlistId: playlistWithThumbnailId, | 103 | playlistId: playlistWithThumbnailId, |
104 | attributes: { videoId: video1 } | 104 | attributes: { videoId: video1 } |
105 | }) | 105 | }) |
@@ -116,13 +116,13 @@ describe('Playlist thumbnail', function () { | |||
116 | it('Should automatically update the thumbnail when moving the first element', async function () { | 116 | it('Should automatically update the thumbnail when moving the first element', async function () { |
117 | this.timeout(30000) | 117 | this.timeout(30000) |
118 | 118 | ||
119 | const added = await servers[1].playlistsCommand.addElement({ | 119 | const added = await servers[1].playlists.addElement({ |
120 | playlistId: playlistWithoutThumbnailId, | 120 | playlistId: playlistWithoutThumbnailId, |
121 | attributes: { videoId: video2 } | 121 | attributes: { videoId: video2 } |
122 | }) | 122 | }) |
123 | withoutThumbnailE2 = added.id | 123 | withoutThumbnailE2 = added.id |
124 | 124 | ||
125 | await servers[1].playlistsCommand.reorderElements({ | 125 | await servers[1].playlists.reorderElements({ |
126 | playlistId: playlistWithoutThumbnailId, | 126 | playlistId: playlistWithoutThumbnailId, |
127 | attributes: { | 127 | attributes: { |
128 | startPosition: 1, | 128 | startPosition: 1, |
@@ -141,13 +141,13 @@ describe('Playlist thumbnail', function () { | |||
141 | it('Should not update the thumbnail when moving the first element if we explicitly uploaded a thumbnail', async function () { | 141 | it('Should not update the thumbnail when moving the first element if we explicitly uploaded a thumbnail', async function () { |
142 | this.timeout(30000) | 142 | this.timeout(30000) |
143 | 143 | ||
144 | const added = await servers[1].playlistsCommand.addElement({ | 144 | const added = await servers[1].playlists.addElement({ |
145 | playlistId: playlistWithThumbnailId, | 145 | playlistId: playlistWithThumbnailId, |
146 | attributes: { videoId: video2 } | 146 | attributes: { videoId: video2 } |
147 | }) | 147 | }) |
148 | withThumbnailE2 = added.id | 148 | withThumbnailE2 = added.id |
149 | 149 | ||
150 | await servers[1].playlistsCommand.reorderElements({ | 150 | await servers[1].playlists.reorderElements({ |
151 | playlistId: playlistWithThumbnailId, | 151 | playlistId: playlistWithThumbnailId, |
152 | attributes: { | 152 | attributes: { |
153 | startPosition: 1, | 153 | startPosition: 1, |
@@ -166,7 +166,7 @@ describe('Playlist thumbnail', function () { | |||
166 | it('Should automatically update the thumbnail when deleting the first element', async function () { | 166 | it('Should automatically update the thumbnail when deleting the first element', async function () { |
167 | this.timeout(30000) | 167 | this.timeout(30000) |
168 | 168 | ||
169 | await servers[1].playlistsCommand.removeElement({ | 169 | await servers[1].playlists.removeElement({ |
170 | playlistId: playlistWithoutThumbnailId, | 170 | playlistId: playlistWithoutThumbnailId, |
171 | elementId: withoutThumbnailE1 | 171 | elementId: withoutThumbnailE1 |
172 | }) | 172 | }) |
@@ -182,7 +182,7 @@ describe('Playlist thumbnail', function () { | |||
182 | it('Should not update the thumbnail when deleting the first element if we explicitly uploaded a thumbnail', async function () { | 182 | it('Should not update the thumbnail when deleting the first element if we explicitly uploaded a thumbnail', async function () { |
183 | this.timeout(30000) | 183 | this.timeout(30000) |
184 | 184 | ||
185 | await servers[1].playlistsCommand.removeElement({ | 185 | await servers[1].playlists.removeElement({ |
186 | playlistId: playlistWithThumbnailId, | 186 | playlistId: playlistWithThumbnailId, |
187 | elementId: withThumbnailE1 | 187 | elementId: withThumbnailE1 |
188 | }) | 188 | }) |
@@ -198,7 +198,7 @@ describe('Playlist thumbnail', function () { | |||
198 | it('Should the thumbnail when we delete the last element', async function () { | 198 | it('Should the thumbnail when we delete the last element', async function () { |
199 | this.timeout(30000) | 199 | this.timeout(30000) |
200 | 200 | ||
201 | await servers[1].playlistsCommand.removeElement({ | 201 | await servers[1].playlists.removeElement({ |
202 | playlistId: playlistWithoutThumbnailId, | 202 | playlistId: playlistWithoutThumbnailId, |
203 | elementId: withoutThumbnailE2 | 203 | elementId: withoutThumbnailE2 |
204 | }) | 204 | }) |
@@ -214,7 +214,7 @@ describe('Playlist thumbnail', function () { | |||
214 | it('Should not update the thumbnail when we delete the last element if we explicitly uploaded a thumbnail', async function () { | 214 | it('Should not update the thumbnail when we delete the last element if we explicitly uploaded a thumbnail', async function () { |
215 | this.timeout(30000) | 215 | this.timeout(30000) |
216 | 216 | ||
217 | await servers[1].playlistsCommand.removeElement({ | 217 | await servers[1].playlists.removeElement({ |
218 | playlistId: playlistWithThumbnailId, | 218 | playlistId: playlistWithThumbnailId, |
219 | elementId: withThumbnailE2 | 219 | elementId: withThumbnailE2 |
220 | }) | 220 | }) |