To align input definitions with the SourceEditor, inputs are now defined globally in the inputs section of the config file.

Each source can reference one or more inputs by their name in the inputs attribute.
This commit is contained in:
euzu
2026-01-03 19:09:39 +01:00
parent 02346cd733
commit da8947dd76
7 changed files with 59 additions and 37 deletions
+5 -4
View File
@@ -29,13 +29,14 @@ pub struct InputStatus {
}
pub fn resolve_input_storage_path(working_dir: &str, input_name: &str) -> PathBuf {
match get_input_storage_path(input_name, working_dir) {
Ok(path) => path,
Err(_) => Path::new(working_dir).join("data").join(format!("input_{input_name}")), // Fallback
if let Ok(path) = get_input_storage_path(input_name, working_dir) { path } else {
let sanitized_name: String = input_name.chars()
.map(|c| if c.is_alphanumeric() { c } else { '_' })
.collect();
Path::new(working_dir).join("data").join(format!("input_{sanitized_name}"))
}
}
pub fn load_input_status(path: &Path) -> InputStatus {
let status_path = path.join(STATUS_FILE);
if status_path.exists() {