import { VideoChannel, VideoChannelSummary } from '../../../shared/models/videos'
import {
isVideoChannelDescriptionValid,
- isVideoChannelNameValid,
+ isVideoChannelDisplayNameValid,
isVideoChannelSupportValid
} from '../../helpers/custom-validators/video-channels'
import { CONSTRAINTS_FIELDS, WEBSERVER } from '../../initializers/constants'
for (const handle of options.handles || []) {
const [ preferredUsername, host ] = handle.split('@')
- if (!host) {
+ if (!host || host === WEBSERVER.HOST) {
or.push({
'$Actor.preferredUsername$': preferredUsername,
'$Actor.serverId$': null
export class VideoChannelModel extends Model<Partial<AttributesOnly<VideoChannelModel>>> {
@AllowNull(false)
- @Is('VideoChannelName', value => throwIfNotValid(value, isVideoChannelNameValid, 'name'))
+ @Is('VideoChannelName', value => throwIfNotValid(value, isVideoChannelDisplayNameValid, 'name'))
@Column
name: string
return this.Actor.isOutdated()
}
- setAsUpdated (transaction: Transaction) {
+ setAsUpdated (transaction?: Transaction) {
return setAsUpdated('videoChannel', this.id, transaction)
}
}