qrm2
qrm2 copied to clipboard
make the band chart/map metadata format be a dictionary?
a dictionary would be more informative at first glance, would probably make it harder to make an error when adding more, and make the qrm-side code simpler.
Example
{
"cn": {
"path": "/resources/bandcharts/cn.png",
"short_name": "China",
"long_name": "Amateur radio bands in China",
"description": "",
"source": "Created by KN8U and NY7H",
"emoji": "🇨🇳"
}
}
This will require me looking at the relevant code and checking what was the reason for using lists. I suspect it was to have a system where omitting a field would cause errors. But I am not exactly sure why that over something else, or is there was more to it.
This would come after I'm done with the actual move (#246) in the existing code
Investigation notes: IIRC the issue with this idea was dataclasses being trash at dealing with supplementary kwargs, which would cause issue at data unpacking if the resource file gains a new key. I think that this was the only issue, and it would be fixed by just using pydantic instead: it's already in the requirements.