mirror of
https://github.com/n08i40k/schedule-parser-rusted.git
synced 2025-12-06 17:57:47 +03:00
feat(schedule)!: move schedule parser, downloader, and updater to external library
This can be used to support more schedule formats in the future.
This commit is contained in:
2
src/state/env/schedule.rs
vendored
2
src/state/env/schedule.rs
vendored
@@ -2,6 +2,7 @@ use std::env;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ScheduleEnvData {
|
||||
#[cfg(not(test))]
|
||||
pub url: Option<String>,
|
||||
pub auto_update: bool,
|
||||
}
|
||||
@@ -9,6 +10,7 @@ pub struct ScheduleEnvData {
|
||||
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")),
|
||||
|
||||
Reference in New Issue
Block a user