diff options
Diffstat (limited to 'server/helpers/custom-validators/video-channels.ts')
-rw-r--r-- | server/helpers/custom-validators/video-channels.ts | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/server/helpers/custom-validators/video-channels.ts b/server/helpers/custom-validators/video-channels.ts index f13519c1d..cbf150e53 100644 --- a/server/helpers/custom-validators/video-channels.ts +++ b/server/helpers/custom-validators/video-channels.ts | |||
@@ -38,11 +38,7 @@ async function isVideoChannelIdExist (id: string, res: express.Response) { | |||
38 | } | 38 | } |
39 | 39 | ||
40 | async function isVideoChannelNameWithHostExist (nameWithDomain: string, res: express.Response) { | 40 | async function isVideoChannelNameWithHostExist (nameWithDomain: string, res: express.Response) { |
41 | const [ name, host ] = nameWithDomain.split('@') | 41 | const videoChannel = await VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithDomain) |
42 | let videoChannel: VideoChannelModel | ||
43 | |||
44 | if (!host || host === CONFIG.WEBSERVER.HOST) videoChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(name) | ||
45 | else videoChannel = await VideoChannelModel.loadByNameAndHostAndPopulateAccount(name, host) | ||
46 | 42 | ||
47 | return processVideoChannelExist(videoChannel, res) | 43 | return processVideoChannelExist(videoChannel, res) |
48 | } | 44 | } |