From 92bf2f62995bbaa0402cb4657473ad8d5b6fcf8d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Feb 2019 14:06:10 +0100 Subject: Improve channel and account SEO --- server/helpers/custom-validators/video-channels.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'server/helpers/custom-validators/video-channels.ts') 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) { } async function isVideoChannelNameWithHostExist (nameWithDomain: string, res: express.Response) { - const [ name, host ] = nameWithDomain.split('@') - let videoChannel: VideoChannelModel - - if (!host || host === CONFIG.WEBSERVER.HOST) videoChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(name) - else videoChannel = await VideoChannelModel.loadByNameAndHostAndPopulateAccount(name, host) + const videoChannel = await VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithDomain) return processVideoChannelExist(videoChannel, res) } -- cgit v1.2.3