From a406e5504d123971495090def83dd127d0aebef7 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Fri, 27 Jan 2023 16:17:47 +0000 Subject: [PATCH] chore: add support for Streamable in media struct --- crates/quark/src/types/january.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/quark/src/types/january.rs b/crates/quark/src/types/january.rs index f626150b..2a8859f5 100644 --- a/crates/quark/src/types/january.rs +++ b/crates/quark/src/types/january.rs @@ -98,6 +98,8 @@ pub enum Special { content_type: BandcampType, id: String, }, + /// Streamable Video + Streamable { id: String }, } /// Website metadata @@ -175,7 +177,12 @@ pub enum Embed { impl Embed { /// Generate embeds from given content - pub async fn generate(content: String, host: &str, max_embeds: usize, semaphore: Arc) -> Result> { + pub async fn generate( + content: String, + host: &str, + max_embeds: usize, + semaphore: Arc, + ) -> Result> { lazy_static! { static ref RE_CODE: Regex = Regex::new("```(?:.|\n)+?```|`(?:.|\n)+?`").unwrap(); static ref RE_IGNORED: Regex = Regex::new("()").unwrap(); @@ -239,12 +246,7 @@ impl Embed { tasks.push(spawn(async move { let guard = semaphore.acquire().await; - let response = client - .get(url) - .query(&[("url", link)]) - .send() - .await - .ok()?; + let response = client.get(url).query(&[("url", link)]).send().await.ok()?; drop(guard);