Added the watch and scheduler systems

This commit is contained in:
Connor Johnstone
2026-03-20 16:28:15 -04:00
parent eaaff5f98f
commit 9d6c0e31c1
16 changed files with 948 additions and 164 deletions

View File

@@ -28,6 +28,8 @@ pub struct ArtistListItem {
pub id: i32,
pub name: String,
pub musicbrainz_id: Option<String>,
#[serde(default)]
pub monitored: bool,
pub total_watched: usize,
pub total_owned: usize,
pub total_items: usize,
@@ -62,6 +64,8 @@ pub struct FullArtistDetail {
#[serde(default)]
pub enriched: bool,
#[serde(default)]
pub monitored: bool,
#[serde(default)]
pub artist_info: Option<ArtistInfoFe>,
#[serde(default)]
pub artist_photo: Option<String>,
@@ -240,6 +244,14 @@ pub struct Status {
#[serde(default)]
pub tagging: Option<TaggingStatus>,
pub tasks: Vec<TaskInfo>,
#[serde(default)]
pub scheduled: Option<ScheduledTasks>,
}
#[derive(Debug, Clone, PartialEq, Deserialize)]
pub struct ScheduledTasks {
pub next_pipeline: Option<String>,
pub next_monitor: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize)]
@@ -297,6 +309,8 @@ pub struct AppConfig {
pub indexing: IndexingConfigFe,
#[serde(default)]
pub metadata: MetadataConfigFe,
#[serde(default)]
pub scheduling: SchedulingConfigFe,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
@@ -376,6 +390,25 @@ impl Default for MetadataConfigFe {
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
pub struct SchedulingConfigFe {
#[serde(default)]
pub pipeline_enabled: bool,
#[serde(default = "default_pipeline_interval_hours")]
pub pipeline_interval_hours: u32,
#[serde(default)]
pub monitor_enabled: bool,
#[serde(default = "default_monitor_interval_hours")]
pub monitor_interval_hours: u32,
}
fn default_pipeline_interval_hours() -> u32 {
3
}
fn default_monitor_interval_hours() -> u32 {
12
}
fn default_metadata_source() -> String {
"musicbrainz".into()
}