diff options
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/video-channel.ts | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/server/lib/video-channel.ts b/server/lib/video-channel.ts index a939a23d5..beb01da9b 100644 --- a/server/lib/video-channel.ts +++ b/server/lib/video-channel.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import { VideoChannelCreate } from '../../shared/models' | 2 | import { VideoChannelCreate } from '../../shared/models' |
3 | import { logger } from '../helpers' | ||
4 | import { database as db } from '../initializers' | 3 | import { database as db } from '../initializers' |
5 | import { AccountInstance } from '../models' | 4 | import { AccountInstance } from '../models' |
6 | import { getVideoChannelActivityPubUrl } from './activitypub/url' | 5 | import { getVideoChannelActivityPubUrl } from './activitypub/url' |
@@ -27,21 +26,8 @@ async function createVideoChannel (videoChannelInfo: VideoChannelCreate, account | |||
27 | return videoChannelCreated | 26 | return videoChannelCreated |
28 | } | 27 | } |
29 | 28 | ||
30 | async function fetchVideoChannelByHostAndUUID (serverHost: string, uuid: string, t: Sequelize.Transaction) { | ||
31 | try { | ||
32 | const videoChannel = await db.VideoChannel.loadByHostAndUUID(serverHost, uuid, t) | ||
33 | if (!videoChannel) throw new Error('Video channel not found') | ||
34 | |||
35 | return videoChannel | ||
36 | } catch (err) { | ||
37 | logger.error('Cannot load video channel from host and uuid.', { error: err.stack, serverHost, uuid }) | ||
38 | throw err | ||
39 | } | ||
40 | } | ||
41 | |||
42 | // --------------------------------------------------------------------------- | 29 | // --------------------------------------------------------------------------- |
43 | 30 | ||
44 | export { | 31 | export { |
45 | createVideoChannel, | 32 | createVideoChannel |
46 | fetchVideoChannelByHostAndUUID | ||
47 | } | 33 | } |