mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-06 07:52:18 +02:00
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user