From a6c1e88a1e360d46a91bc536985db87af72245b3 Mon Sep 17 00:00:00 2001 From: Kevin Brennan Date: Fri, 12 Jul 2024 06:56:57 -0400 Subject: [PATCH] Add youtu.be as a default domain (#251) --- src/guild/settings.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/guild/settings.rs b/src/guild/settings.rs index 640cb1e1..e39f42cc 100644 --- a/src/guild/settings.rs +++ b/src/guild/settings.rs @@ -12,7 +12,7 @@ use std::{ use crate::errors::ParrotError; const DEFAULT_SETTINGS_PATH: &str = "data/settings"; -const DEFAULT_ALLOWED_DOMAINS: [&str; 1] = ["youtube.com"]; +const DEFAULT_ALLOWED_DOMAINS: [&str; 2] = ["youtube.com", "youtu.be"]; lazy_static! { static ref SETTINGS_PATH: String = @@ -103,7 +103,11 @@ impl GuildSettings { } if self.allowed_domains.is_empty() && self.banned_domains.is_empty() { - self.allowed_domains.insert(String::from("youtube.com")); + self.allowed_domains = DEFAULT_ALLOWED_DOMAINS + .iter() + .map(|d| d.to_string()) + .collect(); + self.banned_domains.clear(); } }