Files
schedule-parser-rusted/src/state/env/schedule.rs
n08i40k 5e39fc9acc feat(schedule)!: move schedule parser, downloader, and updater to external library
This can be used to support more schedule formats in the future.
2025-09-02 08:59:59 +04:00

20 lines
446 B
Rust

use std::env;
#[derive(Clone)]
pub struct ScheduleEnvData {
#[cfg(not(test))]
pub url: Option<String>,
pub auto_update: bool,
}
impl Default for ScheduleEnvData {
fn default() -> Self {
Self {
#[cfg(not(test))]
url: env::var("SCHEDULE_INIT_URL").ok(),
auto_update: !env::var("SCHEDULE_DISABLE_AUTO_UPDATE")
.is_ok_and(|v| v.eq("1") || v.eq("true")),
}
}
}