aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/search/search-videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/search/search-videos.ts')
-rw-r--r--server/tests/api/search/search-videos.ts46
1 files changed, 23 insertions, 23 deletions
diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts
index 148499d5f..478ebafc9 100644
--- a/server/tests/api/search/search-videos.ts
+++ b/server/tests/api/search/search-videos.ts
@@ -40,24 +40,24 @@ describe('Test videos search', function () {
40 nsfw: false, 40 nsfw: false,
41 language: 'fr' 41 language: 'fr'
42 } 42 }
43 await server.videosCommand.upload({ attributes: attributes1 }) 43 await server.videos.upload({ attributes: attributes1 })
44 44
45 const attributes2 = { ...attributes1, name: attributes1.name + ' - 2', fixture: 'video_short.mp4' } 45 const attributes2 = { ...attributes1, name: attributes1.name + ' - 2', fixture: 'video_short.mp4' }
46 await server.videosCommand.upload({ attributes: attributes2 }) 46 await server.videos.upload({ attributes: attributes2 })
47 47
48 { 48 {
49 const attributes3 = { ...attributes1, name: attributes1.name + ' - 3', language: undefined } 49 const attributes3 = { ...attributes1, name: attributes1.name + ' - 3', language: undefined }
50 const { id, uuid } = await server.videosCommand.upload({ attributes: attributes3 }) 50 const { id, uuid } = await server.videos.upload({ attributes: attributes3 })
51 videoUUID = uuid 51 videoUUID = uuid
52 52
53 await server.captionsCommand.createVideoCaption({ 53 await server.captions.createVideoCaption({
54 language: 'en', 54 language: 'en',
55 videoId: id, 55 videoId: id,
56 fixture: 'subtitle-good2.vtt', 56 fixture: 'subtitle-good2.vtt',
57 mimeType: 'application/octet-stream' 57 mimeType: 'application/octet-stream'
58 }) 58 })
59 59
60 await server.captionsCommand.createVideoCaption({ 60 await server.captions.createVideoCaption({
61 language: 'aa', 61 language: 'aa',
62 videoId: id, 62 videoId: id,
63 fixture: 'subtitle-good2.vtt', 63 fixture: 'subtitle-good2.vtt',
@@ -66,23 +66,23 @@ describe('Test videos search', function () {
66 } 66 }
67 67
68 const attributes4 = { ...attributes1, name: attributes1.name + ' - 4', language: 'pl', nsfw: true } 68 const attributes4 = { ...attributes1, name: attributes1.name + ' - 4', language: 'pl', nsfw: true }
69 await server.videosCommand.upload({ attributes: attributes4 }) 69 await server.videos.upload({ attributes: attributes4 })
70 70
71 await wait(1000) 71 await wait(1000)
72 72
73 startDate = new Date().toISOString() 73 startDate = new Date().toISOString()
74 74
75 const attributes5 = { ...attributes1, name: attributes1.name + ' - 5', licence: 2, language: undefined } 75 const attributes5 = { ...attributes1, name: attributes1.name + ' - 5', licence: 2, language: undefined }
76 await server.videosCommand.upload({ attributes: attributes5 }) 76 await server.videos.upload({ attributes: attributes5 })
77 77
78 const attributes6 = { ...attributes1, name: attributes1.name + ' - 6', tags: [ 't1', 't2' ] } 78 const attributes6 = { ...attributes1, name: attributes1.name + ' - 6', tags: [ 't1', 't2' ] }
79 await server.videosCommand.upload({ attributes: attributes6 }) 79 await server.videos.upload({ attributes: attributes6 })
80 80
81 const attributes7 = { ...attributes1, name: attributes1.name + ' - 7', originallyPublishedAt: '2019-02-12T09:58:08.286Z' } 81 const attributes7 = { ...attributes1, name: attributes1.name + ' - 7', originallyPublishedAt: '2019-02-12T09:58:08.286Z' }
82 await server.videosCommand.upload({ attributes: attributes7 }) 82 await server.videos.upload({ attributes: attributes7 })
83 83
84 const attributes8 = { ...attributes1, name: attributes1.name + ' - 8', licence: 4 } 84 const attributes8 = { ...attributes1, name: attributes1.name + ' - 8', licence: 4 }
85 await server.videosCommand.upload({ attributes: attributes8 }) 85 await server.videos.upload({ attributes: attributes8 })
86 } 86 }
87 87
88 { 88 {
@@ -93,9 +93,9 @@ describe('Test videos search', function () {
93 licence: 2, 93 licence: 2,
94 language: 'en' 94 language: 'en'
95 } 95 }
96 await server.videosCommand.upload({ attributes: attributes }) 96 await server.videos.upload({ attributes: attributes })
97 97
98 await server.videosCommand.upload({ attributes: { ...attributes, name: attributes.name + ' duplicate' } }) 98 await server.videos.upload({ attributes: { ...attributes, name: attributes.name + ' duplicate' } })
99 } 99 }
100 100
101 { 101 {
@@ -106,7 +106,7 @@ describe('Test videos search', function () {
106 licence: 3, 106 licence: 3,
107 language: 'pl' 107 language: 'pl'
108 } 108 }
109 await server.videosCommand.upload({ attributes: attributes }) 109 await server.videos.upload({ attributes: attributes })
110 } 110 }
111 111
112 { 112 {
@@ -115,11 +115,11 @@ describe('Test videos search', function () {
115 tags: [ 'aaaa', 'bbbb', 'cccc' ], 115 tags: [ 'aaaa', 'bbbb', 'cccc' ],
116 category: 1 116 category: 1
117 } 117 }
118 await server.videosCommand.upload({ attributes: attributes1 }) 118 await server.videos.upload({ attributes: attributes1 })
119 await server.videosCommand.upload({ attributes: { ...attributes1, category: 2 } }) 119 await server.videos.upload({ attributes: { ...attributes1, category: 2 } })
120 120
121 await server.videosCommand.upload({ attributes: { ...attributes1, tags: [ 'cccc', 'dddd' ] } }) 121 await server.videos.upload({ attributes: { ...attributes1, tags: [ 'cccc', 'dddd' ] } })
122 await server.videosCommand.upload({ attributes: { ...attributes1, tags: [ 'eeee', 'ffff' ] } }) 122 await server.videos.upload({ attributes: { ...attributes1, tags: [ 'eeee', 'ffff' ] } })
123 } 123 }
124 124
125 { 125 {
@@ -127,11 +127,11 @@ describe('Test videos search', function () {
127 name: 'aaaa 2', 127 name: 'aaaa 2',
128 category: 1 128 category: 1
129 } 129 }
130 await server.videosCommand.upload({ attributes: attributes1 }) 130 await server.videos.upload({ attributes: attributes1 })
131 await server.videosCommand.upload({ attributes: { ...attributes1, category: 2 } }) 131 await server.videos.upload({ attributes: { ...attributes1, category: 2 } })
132 } 132 }
133 133
134 command = server.searchCommand 134 command = server.search
135 }) 135 })
136 136
137 it('Should make a simple search and not have results', async function () { 137 it('Should make a simple search and not have results', async function () {
@@ -479,7 +479,7 @@ describe('Test videos search', function () {
479 }, 479 },
480 live: { enabled: true } 480 live: { enabled: true }
481 } 481 }
482 await server.configCommand.updateCustomSubConfig({ newConfig }) 482 await server.config.updateCustomSubConfig({ newConfig })
483 } 483 }
484 484
485 { 485 {
@@ -490,9 +490,9 @@ describe('Test videos search', function () {
490 } 490 }
491 491
492 { 492 {
493 const liveCommand = server.liveCommand 493 const liveCommand = server.live
494 494
495 const liveAttributes = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: server.videoChannel.id } 495 const liveAttributes = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: server.store.channel.id }
496 const live = await liveCommand.create({ fields: liveAttributes }) 496 const live = await liveCommand.create({ fields: liveAttributes })
497 497
498 const ffmpegCommand = await liveCommand.sendRTMPStreamInVideo({ videoId: live.id }) 498 const ffmpegCommand = await liveCommand.sendRTMPStreamInVideo({ videoId: live.id })