aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/channels.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-13 14:23:01 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (patch)
tree7a166515e4d57a06eb3c08be569f106ed049988b /shared/extra-utils/videos/channels.ts
parentd0a0fa429d4651710ed951a3c11af0219e408964 (diff)
downloadPeerTube-7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0.tar.gz
PeerTube-7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0.tar.zst
PeerTube-7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0.zip
Introduce user command
Diffstat (limited to 'shared/extra-utils/videos/channels.ts')
-rw-r--r--shared/extra-utils/videos/channels.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/shared/extra-utils/videos/channels.ts b/shared/extra-utils/videos/channels.ts
index a77543c92..9e7ec565d 100644
--- a/shared/extra-utils/videos/channels.ts
+++ b/shared/extra-utils/videos/channels.ts
@@ -1,13 +1,11 @@
1import { User } from '../../models/users/user.model'
2import { ServerInfo } from '../server/servers' 1import { ServerInfo } from '../server/servers'
3import { getMyUserInformation } from '../users/users'
4 2
5function setDefaultVideoChannel (servers: ServerInfo[]) { 3function setDefaultVideoChannel (servers: ServerInfo[]) {
6 const tasks: Promise<any>[] = [] 4 const tasks: Promise<any>[] = []
7 5
8 for (const server of servers) { 6 for (const server of servers) {
9 const p = getMyUserInformation(server.url, server.accessToken) 7 const p = server.usersCommand.getMyInfo()
10 .then(res => { server.videoChannel = (res.body as User).videoChannels[0] }) 8 .then(user => { server.videoChannel = user.videoChannels[0] })
11 9
12 tasks.push(p) 10 tasks.push(p)
13 } 11 }