From 245ffc8396b8cb03b7fb163f3d9fafa4818dac5a Mon Sep 17 00:00:00 2001 From: syeopite Date: Mon, 25 Aug 2025 01:35:40 -0700 Subject: [PATCH] Mark attributes set over env var as present if needed --- src/invidious/config.cr | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/invidious/config.cr b/src/invidious/config.cr index f218cb69f..848a8a950 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -285,6 +285,12 @@ class Config begin config.{{ivar.id}} = ivar_type.from_yaml(env_value) success = true + + # Update associated _present key if any + {% other_ivar = @type.instance_vars.find { |other_ivar| other_ivar.name == ivar.name + "_present" } %} + {% if other_ivar && (ann = other_ivar.annotation(YAML::Field)) && ann[:ignore] == true %} + config.{{other_ivar.name.id}} = true + {% end %} rescue # nop end