Added the watch and scheduler systems
All checks were successful
CI / check (push) Successful in 1m10s
CI / docker (push) Successful in 2m40s

This commit is contained in:
Connor Johnstone
2026-03-20 16:28:15 -04:00
parent 4ec47252d9
commit 4008b4d838
8 changed files with 54 additions and 5 deletions

View File

@@ -35,6 +35,9 @@ pub struct AppConfig {
#[serde(default)]
pub metadata: MetadataConfig,
#[serde(default)]
pub scheduling: SchedulingConfig,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -130,6 +133,36 @@ pub struct MetadataConfig {
pub fanart_api_key: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SchedulingConfig {
/// Enable automatic pipeline runs.
#[serde(default)]
pub pipeline_enabled: bool,
/// Hours between pipeline runs (after previous completion).
#[serde(default = "default_pipeline_interval_hours")]
pub pipeline_interval_hours: u32,
/// Enable automatic new release checking for monitored artists.
#[serde(default)]
pub monitor_enabled: bool,
/// Hours between monitor checks.
#[serde(default = "default_monitor_interval_hours")]
pub monitor_interval_hours: u32,
}
impl Default for SchedulingConfig {
fn default() -> Self {
Self {
pipeline_enabled: true,
pipeline_interval_hours: default_pipeline_interval_hours(),
monitor_enabled: true,
monitor_interval_hours: default_monitor_interval_hours(),
}
}
}
// --- Defaults ---
impl Default for AppConfig {
@@ -145,6 +178,7 @@ impl Default for AppConfig {
download: DownloadConfig::default(),
indexing: IndexingConfig::default(),
metadata: MetadataConfig::default(),
scheduling: SchedulingConfig::default(),
}
}
}
@@ -272,6 +306,12 @@ fn default_lyrics_source() -> String {
fn default_cover_art_source() -> String {
"coverartarchive".to_string()
}
fn default_pipeline_interval_hours() -> u32 {
3
}
fn default_monitor_interval_hours() -> u32 {
12
}
fn default_cookie_refresh_hours() -> u32 {
6
}