Bomp version

parent 92f02e36
......@@ -400,11 +400,15 @@ class AppSettings:
def to_dict(self) -> Dict[str, Any]:
"""Convert settings to dictionary"""
# Create a copy of API config without user_agent (it's hardcoded)
api_dict = self.api.__dict__.copy()
api_dict.pop('user_agent', None)
return {
"database": self.database.__dict__,
"web": self.web.__dict__,
"qt": self.qt.__dict__,
"api": self.api.__dict__,
"api": api_dict,
"logging": self.logging.__dict__,
"screen_cast": self.screen_cast.__dict__,
"general": self.general.__dict__,
......@@ -434,7 +438,10 @@ class AppSettings:
if "qt" in data:
settings.qt = QtConfig(**data["qt"])
if "api" in data:
settings.api = ApiConfig(**data["api"])
# Create API config but preserve the hardcoded user_agent
api_data = data["api"].copy()
api_data.pop('user_agent', None) # Remove any stored user_agent to use default
settings.api = ApiConfig(**api_data)
if "logging" in data:
settings.logging = LoggingConfig(**data["logging"])
if "screen_cast" in data:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment