aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video-channel.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-23 17:36:15 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:53 +0100
commit39445ead45aaaea801ec09991b8dd2464f722e47 (patch)
tree9306c6b89115dabdd4a7c31a59784134a0e1c804 /server/lib/video-channel.ts
parent16b90975941b78d01d7202d441bf731a10048c16 (diff)
downloadPeerTube-39445ead45aaaea801ec09991b8dd2464f722e47.tar.gz
PeerTube-39445ead45aaaea801ec09991b8dd2464f722e47.tar.zst
PeerTube-39445ead45aaaea801ec09991b8dd2464f722e47.zip
Cleanup models
Diffstat (limited to 'server/lib/video-channel.ts')
-rw-r--r--server/lib/video-channel.ts16
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 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import { VideoChannelCreate } from '../../shared/models' 2import { VideoChannelCreate } from '../../shared/models'
3import { logger } from '../helpers'
4import { database as db } from '../initializers' 3import { database as db } from '../initializers'
5import { AccountInstance } from '../models' 4import { AccountInstance } from '../models'
6import { getVideoChannelActivityPubUrl } from './activitypub/url' 5import { getVideoChannelActivityPubUrl } from './activitypub/url'
@@ -27,21 +26,8 @@ async function createVideoChannel (videoChannelInfo: VideoChannelCreate, account
27 return videoChannelCreated 26 return videoChannelCreated
28} 27}
29 28
30async 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
44export { 31export {
45 createVideoChannel, 32 createVideoChannel
46 fetchVideoChannelByHostAndUUID
47} 33}