aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/channels.ts
blob: 9e7ec565d20e2d5caeb47cd02584f1028bca62a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { ServerInfo } from '../server/servers'

function setDefaultVideoChannel (servers: ServerInfo[]) {
  const tasks: Promise<any>[] = []

  for (const server of servers) {
    const p = server.usersCommand.getMyInfo()
      .then(user => { server.videoChannel = user.videoChannels[0] })

    tasks.push(p)
  }

  return Promise.all(tasks)
}

export {
  setDefaultVideoChannel
}