diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-23 17:36:15 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:53 +0100 |
commit | 39445ead45aaaea801ec09991b8dd2464f722e47 (patch) | |
tree | 9306c6b89115dabdd4a7c31a59784134a0e1c804 /server/lib/video-channel.ts | |
parent | 16b90975941b78d01d7202d441bf731a10048c16 (diff) | |
download | PeerTube-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.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 | } |