-async function doesLocalVideoChannelNameExist (name: string, res: express.Response) {
- const videoChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(name)
-
- return processVideoChannelExist(videoChannel, res)
-}
-
-async function doesVideoChannelIdExist (id: number | string, res: express.Response) {
- let videoChannel: VideoChannelModel
- if (validator.isInt('' + id)) {
- videoChannel = await VideoChannelModel.loadAndPopulateAccount(+id)
- } else { // UUID
- videoChannel = await VideoChannelModel.loadByUUIDAndPopulateAccount('' + id)
- }
-
- return processVideoChannelExist(videoChannel, res)
-}
-
-async function doesVideoChannelNameWithHostExist (nameWithDomain: string, res: express.Response) {
- const videoChannel = await VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithDomain)
-
- return processVideoChannelExist(videoChannel, res)
-}
-