diff options
Diffstat (limited to 'shared/extra-utils/videos/video-channels.ts')
-rw-r--r-- | shared/extra-utils/videos/video-channels.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/shared/extra-utils/videos/video-channels.ts b/shared/extra-utils/videos/video-channels.ts index d0dfb5856..0aab93e52 100644 --- a/shared/extra-utils/videos/video-channels.ts +++ b/shared/extra-utils/videos/video-channels.ts | |||
@@ -5,7 +5,7 @@ import { VideoChannelUpdate } from '../../models/videos/channel/video-channel-up | |||
5 | import { VideoChannelCreate } from '../../models/videos/channel/video-channel-create.model' | 5 | import { VideoChannelCreate } from '../../models/videos/channel/video-channel-create.model' |
6 | import { makeDeleteRequest, makeGetRequest, updateImageRequest } from '../requests/requests' | 6 | import { makeDeleteRequest, makeGetRequest, updateImageRequest } from '../requests/requests' |
7 | import { ServerInfo } from '../server/servers' | 7 | import { ServerInfo } from '../server/servers' |
8 | import { User } from '../../models/users/user.model' | 8 | import { MyUser, User } from '../../models/users/user.model' |
9 | import { getMyUserInformation } from '../users/users' | 9 | import { getMyUserInformation } from '../users/users' |
10 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | 10 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' |
11 | 11 | ||
@@ -170,6 +170,12 @@ function setDefaultVideoChannel (servers: ServerInfo[]) { | |||
170 | return Promise.all(tasks) | 170 | return Promise.all(tasks) |
171 | } | 171 | } |
172 | 172 | ||
173 | async function getDefaultVideoChannel (url: string, token: string) { | ||
174 | const res = await getMyUserInformation(url, token) | ||
175 | |||
176 | return (res.body as MyUser).videoChannels[0].id | ||
177 | } | ||
178 | |||
173 | // --------------------------------------------------------------------------- | 179 | // --------------------------------------------------------------------------- |
174 | 180 | ||
175 | export { | 181 | export { |
@@ -181,5 +187,6 @@ export { | |||
181 | deleteVideoChannel, | 187 | deleteVideoChannel, |
182 | getVideoChannel, | 188 | getVideoChannel, |
183 | setDefaultVideoChannel, | 189 | setDefaultVideoChannel, |
184 | deleteVideoChannelImage | 190 | deleteVideoChannelImage, |
191 | getDefaultVideoChannel | ||
185 | } | 192 | } |