]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/form-validators/video-channel-validators.ts
Add Podcast RSS feeds (#5487)
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / form-validators / video-channel-validators.ts
index 163faf270950a30b0de2ec1bdd69895557d12692..b12b3caafb9ac53b213db37e0b2be041fa3b6cc2 100644 (file)
@@ -48,3 +48,16 @@ export const VIDEO_CHANNEL_SUPPORT_VALIDATOR: BuildFormValidator = {
     maxlength: $localize`Support text cannot be more than 1000 characters long.`
   }
 }
+
+export const VIDEO_CHANNEL_EXTERNAL_URL_VALIDATOR: BuildFormValidator = {
+  VALIDATORS: [
+    Validators.required,
+    Validators.pattern(/^https?:\/\//),
+    Validators.maxLength(1000)
+  ],
+  MESSAGES: {
+    required: $localize`Remote channel url is required.`,
+    pattern: $localize`External channel URL must begin with "https://" or "http://"`,
+    maxlength: $localize`External channel URL cannot be more than 1000 characters long`
+  }
+}