From be33662355fd94751383e892f015c94ee397987a Mon Sep 17 00:00:00 2001 From: kmgb Date: Fri, 31 May 2024 17:49:53 -0400 Subject: [PATCH] Add youtu.be as a default domain --- 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(); } }