mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-15 16:27:14 +00:00
feat(ugc): read one model's makes with their options
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -482,6 +482,7 @@ public:
|
||||
uint64_t ResetPropertyUgcModelProcessing(const LWOOBJID propertyId, const std::string_view options) override;
|
||||
void RecordUgcModelRun(const ProcessRun& run) override;
|
||||
std::vector<IUgc::RunSummary> GetUgcRunSummaries() override;
|
||||
std::vector<IUgc::ModelRun> GetUgcModelRuns(const LWOOBJID id, const uint32_t limit) override;
|
||||
IUgc::ProcessTotals GetUgcProcessTotals(const bool modular) override;
|
||||
std::vector<IUgc::ProcessInfo> GetUgcProcessList(const std::optional<eProcessState> state, const std::string_view search, const uint32_t offset, const uint32_t limit) override;
|
||||
std::vector<std::pair<IUgc::eProcessState, uint64_t>> GetUgcProcessCounts() override;
|
||||
|
||||
@@ -192,6 +192,18 @@ std::vector<IUgc::RunSummary> MySQLDatabase::GetUgcRunSummaries() {
|
||||
return summaries;
|
||||
}
|
||||
|
||||
std::vector<IUgc::ModelRun> MySQLDatabase::GetUgcModelRuns(const LWOOBJID id, const uint32_t limit) {
|
||||
auto result = ExecuteSelect("SELECT made_at, options, process_ms, process_cpu_ms, hsr_ms, ao_ms, icon_ms, bricks, triangles_before, triangles FROM ugc_process_runs "
|
||||
"WHERE ugc_id = ? ORDER BY made_at DESC, id DESC LIMIT ?;", id, limit);
|
||||
std::vector<ModelRun> runs;
|
||||
while (result->next()) {
|
||||
const auto field = [&](const char* name) { return static_cast<uint32_t>(result->getUInt(name)); };
|
||||
runs.push_back({ result->getInt64("made_at"), { id, std::string(result->getString("options").c_str()), field("process_ms"), field("process_cpu_ms"),
|
||||
field("hsr_ms"), field("ao_ms"), field("icon_ms"), field("bricks"), field("triangles_before"), field("triangles") } });
|
||||
}
|
||||
return runs;
|
||||
}
|
||||
|
||||
std::vector<IUgc::ProcessInfo> MySQLDatabase::GetUgcProcessList(const std::optional<eProcessState> state, const std::string_view search, const uint32_t offset, const uint32_t limit) {
|
||||
const std::string select =
|
||||
"SELECT u.id, u.character_id, c.name AS character_name, u.is_optimized, u.process_attempts, u.processed_at, u.process_error, u.bake_ao, u.process_after "
|
||||
|
||||
Reference in New Issue
Block a user