feat(ugc): models with no bricks are "empty", not failed

A model with no bricks has nothing to make: it gets its own state
(is_optimized = 3), isn't counted as a failure or retried, shows as Empty
on the UGC page (with its own filter and count), in the status and in
Prometheus, and its downloads answer 404 like HKX. State names come from
the enum (magic_enum). Migrations dlu/mysql/87 and dlu/sqlite/70 move the
rows that failed only because they had no bricks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 14:52:03 -05:00
parent b4fa732047
commit 5de59b99ef
17 changed files with 90 additions and 29 deletions

View File

@@ -142,6 +142,13 @@ namespace UgcModel {
return parts;
}
bool HasNoBricks(std::string_view lxfml) {
tinyxml2::XMLDocument doc;
if (doc.Parse(lxfml.data(), lxfml.size()) != tinyxml2::XML_SUCCESS || !doc.FirstChildElement("LXFML")) return false;
std::string error;
return ParseLxfml(lxfml, error).empty() && lxfml.find("<Part") == std::string_view::npos;
}
void Mesh::Append(const Mesh& other) {
const auto base = static_cast<uint32_t>(positions.size());
positions.insert(positions.end(), other.positions.begin(), other.positions.end());