diff options
Diffstat (limited to 'shared/server-commands/videos/channels.ts')
-rw-r--r-- | shared/server-commands/videos/channels.ts | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/shared/server-commands/videos/channels.ts b/shared/server-commands/videos/channels.ts deleted file mode 100644 index 3c0d4b723..000000000 --- a/shared/server-commands/videos/channels.ts +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | import { PeerTubeServer } from '../server/server' | ||
2 | |||
3 | function setDefaultVideoChannel (servers: PeerTubeServer[]) { | ||
4 | const tasks: Promise<any>[] = [] | ||
5 | |||
6 | for (const server of servers) { | ||
7 | const p = server.users.getMyInfo() | ||
8 | .then(user => { server.store.channel = user.videoChannels[0] }) | ||
9 | |||
10 | tasks.push(p) | ||
11 | } | ||
12 | |||
13 | return Promise.all(tasks) | ||
14 | } | ||
15 | |||
16 | async function setDefaultChannelAvatar (serversArg: PeerTubeServer | PeerTubeServer[], channelName: string = 'root_channel') { | ||
17 | const servers = Array.isArray(serversArg) | ||
18 | ? serversArg | ||
19 | : [ serversArg ] | ||
20 | |||
21 | for (const server of servers) { | ||
22 | await server.channels.updateImage({ channelName, fixture: 'avatar.png', type: 'avatar' }) | ||
23 | } | ||
24 | } | ||
25 | |||
26 | export { | ||
27 | setDefaultVideoChannel, | ||
28 | setDefaultChannelAvatar | ||
29 | } | ||