diff options
Diffstat (limited to 'shared/extra-utils/videos')
-rw-r--r-- | shared/extra-utils/videos/channels-command.ts | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/shared/extra-utils/videos/channels-command.ts b/shared/extra-utils/videos/channels-command.ts index 255e1d62d..e406e570b 100644 --- a/shared/extra-utils/videos/channels-command.ts +++ b/shared/extra-utils/videos/channels-command.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { pick } from '@shared/core-utils' | 1 | import { pick } from '@shared/core-utils' |
2 | import { HttpStatusCode, ResultList, VideoChannel, VideoChannelCreateResult } from '@shared/models' | 2 | import { ActorFollow, HttpStatusCode, ResultList, VideoChannel, VideoChannelCreateResult } from '@shared/models' |
3 | import { VideoChannelCreate } from '../../models/videos/channel/video-channel-create.model' | 3 | import { VideoChannelCreate } from '../../models/videos/channel/video-channel-create.model' |
4 | import { VideoChannelUpdate } from '../../models/videos/channel/video-channel-update.model' | 4 | import { VideoChannelUpdate } from '../../models/videos/channel/video-channel-update.model' |
5 | import { unwrapBody } from '../requests' | 5 | import { unwrapBody } from '../requests' |
@@ -47,7 +47,7 @@ export class ChannelsCommand extends AbstractCommand { | |||
47 | } | 47 | } |
48 | 48 | ||
49 | async create (options: OverrideCommandOptions & { | 49 | async create (options: OverrideCommandOptions & { |
50 | attributes: VideoChannelCreate | 50 | attributes: Partial<VideoChannelCreate> |
51 | }) { | 51 | }) { |
52 | const path = '/api/v1/video-channels/' | 52 | const path = '/api/v1/video-channels/' |
53 | 53 | ||
@@ -153,4 +153,26 @@ export class ChannelsCommand extends AbstractCommand { | |||
153 | defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 | 153 | defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 |
154 | }) | 154 | }) |
155 | } | 155 | } |
156 | |||
157 | listFollowers (options: OverrideCommandOptions & { | ||
158 | channelName: string | ||
159 | start?: number | ||
160 | count?: number | ||
161 | sort?: string | ||
162 | search?: string | ||
163 | }) { | ||
164 | const { channelName, start, count, sort, search } = options | ||
165 | const path = '/api/v1/video-channels/' + channelName + '/followers' | ||
166 | |||
167 | const query = { start, count, sort, search } | ||
168 | |||
169 | return this.getRequestBody<ResultList<ActorFollow>>({ | ||
170 | ...options, | ||
171 | |||
172 | path, | ||
173 | query, | ||
174 | implicitToken: true, | ||
175 | defaultExpectedStatus: HttpStatusCode.OK_200 | ||
176 | }) | ||
177 | } | ||
156 | } | 178 | } |