The code still needs a lot of cleanup before I can submit a PR to Gitea, but I'll do that tomorrow!