PeerTube/shared/extra-utils/videos/channels.ts

19 lines
383 B
TypeScript
Raw Normal View History

2021-07-16 09:47:51 +02:00
import { PeerTubeServer } from '../server/server'
2021-07-09 11:21:30 +02:00
2021-07-16 09:47:51 +02:00
function setDefaultVideoChannel (servers: PeerTubeServer[]) {
2021-07-09 11:21:30 +02:00
const tasks: Promise<any>[] = []
for (const server of servers) {
2021-07-16 09:04:35 +02:00
const p = server.users.getMyInfo()
.then(user => { server.store.channel = user.videoChannels[0] })
2021-07-09 11:21:30 +02:00
tasks.push(p)
}
return Promise.all(tasks)
}
export {
setDefaultVideoChannel
}