aboutsummaryrefslogblamecommitdiffhomepage
path: root/shared/server-commands/videos/channels.ts
blob: 756c47453fef4ac4893193ef3d469141bf64d2ac (plain) (tree)
1
2
3
4
5
6
7
8
                                                 
 
                                                             


                                  

                                                                     









                           
import { PeerTubeServer } from '../server/server'

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

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

    tasks.push(p)
  }

  return Promise.all(tasks)
}

export {
  setDefaultVideoChannel
}