Post-grab async background swap, upgrade_locked flag to prevent the upgrade loop from re-inflating a locally-transcoded file, and a transcode-library CLI backfill for the existing catalog. Bitrate model calibrated against Silicon Valley's real HEVC bitrate, scaled by resolution and AV1's encoding efficiency. HDR/2160p and anime excluded from this first pass. Jellyfin session polling throttles batch encoding back to 1 stream during active playback.
26 lines
885 B
Rust
26 lines
885 B
Rust
use axum::extract::State;
|
|
use axum::Json;
|
|
use breadarr_shared::dto::{CycleInfo, HealthDetail};
|
|
|
|
use crate::api::AppState;
|
|
|
|
fn to_info(r: &crate::api::CycleRecord) -> CycleInfo {
|
|
CycleInfo {
|
|
at: r.at,
|
|
ok: r.ok,
|
|
detail: r.detail.clone(),
|
|
}
|
|
}
|
|
|
|
pub async fn health(State(state): State<AppState>) -> Json<HealthDetail> {
|
|
let status = state.cycle_status.lock().expect("cycle_status poisoned");
|
|
Json(HealthDetail {
|
|
status: "ok".to_string(),
|
|
last_grab_cycle: status.last_grab.as_ref().map(to_info),
|
|
last_import_cycle: status.last_import.as_ref().map(to_info),
|
|
last_search_cycle: status.last_search.as_ref().map(to_info),
|
|
last_upgrade_cycle: status.last_upgrade.as_ref().map(to_info),
|
|
last_transcode_cycle: status.last_transcode.as_ref().map(to_info),
|
|
search_halted: status.search_halted,
|
|
})
|
|
}
|