GUI: Fix #156 when setting empty strings

This commit is contained in:
deajan 2025-04-16 19:04:24 +02:00
parent 0ed031a790
commit 4d6c48e91f

View file

@ -838,15 +838,21 @@ def config_gui(full_config: dict, config_file: str):
"repo_opts.upload_speed", "repo_opts.upload_speed",
"repo_opts.download_speed", "repo_opts.download_speed",
): ):
if ( try:
full_config.g(inheritance_key) is not None if (
and value is not None full_config.g(inheritance_key) not in (None, "")
and ( and value not in (None, "")
BytesConverter(full_config.g(inheritance_key)).bytes and (
== BytesConverter(value).bytes BytesConverter(full_config.g(inheritance_key)).bytes
== BytesConverter(value).bytes
)
):
continue
except ValueError as exc:
logger.debug(
f"BytesConverter could not convert value: {exc}"
) )
): pass
continue
# Don't bother to update empty strings, empty lists and None # Don't bother to update empty strings, empty lists and None
# unless we have False, or 0, which or course need to be updated # unless we have False, or 0, which or course need to be updated