diff --git a/src/main.rs b/src/main.rs --- a/src/main.rs +++ b/src/main.rs @@ -65,9 +65,7 @@ "debug,vodplace=trace,jacquard_identity=info,jacquard_common=info,reqwest=warn", ); - let reg = Registry::default() - .with(filter) - .with(wasm_layer); + let reg = Registry::default().with(filter).with(wasm_layer); let _ = set_global_default(reg); } @@ -131,17 +129,18 @@ }) .unwrap_or_default(); + let site_og_image = format!("https://vod.place{OG_SITE_IMAGE}"); rsx! { document::Title { "vodplace" } document::Meta { property: "og:title", content: "vod.place" } document::Meta { property: "og:description", content: "the place for VODs" } - document::Meta { property: "og:image", content: "{OG_SITE_IMAGE}" } + document::Meta { property: "og:image", content: "{site_og_image}" } document::Meta { property: "og:type", content: "website" } document::Meta { property: "og:url", content: "https://vod.place" } document::Meta { name: "twitter:card", content: "summary_large_image" } document::Meta { name: "twitter:title", content: "vod.place" } document::Meta { name: "twitter:description", content: "the place for VODs" } - document::Meta { name: "twitter:image", content: "{OG_SITE_IMAGE}" } + document::Meta { name: "twitter:image", content: "{site_og_image}" } div { class: "browse-page", div { class: "browse-header", h1 { "vodplace" } @@ -228,7 +227,8 @@ mql.unchecked_ref::(), "change", move |event| { - if let Ok(mql_event) = event.clone().dyn_into::() { + if let Ok(mql_event) = event.clone().dyn_into::() + { let _ = is_narrow.try_write().map(|mut v| *v = mql_event.matches()); } }, @@ -367,7 +367,9 @@ } // 1920×1080 is the canonical PlayRes reference resolution. // The renderer scales to actual display dimensions via SubtitleResize. - if let Ok(ass_text) = vodplace_subtitle::ionosphere_to_ass(&input, 1920, 1080) { + if let Ok(ass_text) = + vodplace_subtitle::ionosphere_to_ass(&input, 1920, 1080) + { subtitle_request.set(Some(player::component::SubtitleRequest { ass_text, source: player::component::SubtitleSource::Ionosphere, @@ -414,12 +416,8 @@ let comments = comment_data.read(); let transcript = transcript_data.read(); let comments = comments.as_ref()?; - Some(build_comment_tree( - comments, - transcript.as_ref(), - )) + Some(build_comment_tree(comments, transcript.as_ref())) }); - // Seek callback for transcript panel — directly sets video currentTime. #[allow(unused_variables)] @@ -449,17 +447,27 @@ Stylesheet { href: COMMENTS_CSS } Stylesheet { href: TABS_CSS } if let Some(Some(ref meta)) = *metadata.read() { - document::Title { "{meta.title} — vodplace" } + document::Title { "{meta.title} - vodplace" } { - let description = if meta.speakers.is_empty() { - format!("Watch on vod.place") - } else { - let names: Vec<&str> = meta.speakers.iter().map(|s| s.name.as_ref()).collect(); - format!("{} — vod.place", names.join(", ")) + let description = { + let speakers = if meta.speakers.is_empty() { + None + } else { + let names: Vec<&str> = meta.speakers.iter().map(|s| s.name.as_ref()).collect(); + Some(names.join(", ")) + }; + let talk_desc: Option<&str> = meta.talk.as_ref().and_then(|t| t.description.as_ref()).map(|d| d.as_ref()); + match (speakers, talk_desc) { + (Some(s), Some(d)) => format!("By {s} - {d}"), + (Some(s), None) => s, + (None, Some(d)) => d.to_string(), + (None, None) => "Watch on vod.place".to_string(), + } }; let og_image = match &meta.thumbnail_url { - Some(url) => url.to_string(), - None => OG_SITE_IMAGE.to_string(), + Some(url) if url.starts_with("http") => url.to_string(), + Some(url) => format!("https://vod.place{url}"), + None => format!("https://vod.place{OG_SITE_IMAGE}"), }; let watch_url = format!("https://vod.place/watch?uri={}", meta.at_uri.as_str()); rsx! {