// Runtime bootstrap. Called once from Kotlin's StrawApp.onCreate via // init_logging(). Wires the strawcore-core Downloader + Localization // singleton so the extractor calls have an HTTP client to use. use std::sync::{Arc, Once}; use strawcore_core::downloader::ReqwestDownloader; use strawcore_core::localization::{ContentCountry, Localization}; use strawcore_core::newpipe::NewPipe; static INIT: Once = Once::new(); pub fn ensure_initialized() { INIT.call_once(|| { match ReqwestDownloader::new() { Ok(dl) => { NewPipe::init_full( Arc::new(dl), Localization::default(), ContentCountry::default(), ); log::info!("strawcore-core: downloader + localization initialized"); } Err(e) => { log::error!("strawcore-core: failed to build downloader: {e}"); } } }); }