Add sortable editor ratings and payroll comparisons (by Codex)
OBW Editor / editor (linux-x64, ubuntu-24.04) (push) Waiting to run
OBW Editor / editor (macos-arm64, macos-14) (push) Waiting to run
OBW Editor / editor (windows-x64, windows-2022) (push) Waiting to run

This commit is contained in:
Codex committed 2026-10-23 05:26:10 +02:00
1 parent a447d9282a
commit 221478b629
26 files changed
+1311 -43

No files matched your search

+15
View File
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
#include "editor/session.hpp"
#include "content/digest.hpp"
#include "editor/comparison.hpp"
#include "editor/images.hpp"
#include <algorithm>
#include <limits>
@@ -435,6 +436,20 @@ Json Session::execute(const std::string &command, const Json &args) {
auto &w = world();
if (command == "list")
return w.query(args);
if (command == "compare") {
const Json key{{"table", str(args, "table", "players")},
{"attribute_set", str(args, "attribute_set")},
{"language", str(args, "language", "de")}};
if (comparison_revision_ != revision_ || comparison_key_ != key.dump()) {
auto data = comparison_data(w, key);
comparison_cache_ = std::move(data);
comparison_key_ = key.dump();
comparison_revision_ = revision_;
}
auto result = query_comparison(comparison_cache_, args);
result["revision"] = revision_;
return result;
}
if (command == "get") {
auto name = str(args, "table"), id = str(args, "id");
const auto *found = name == "manifest" ? &w.manifest : w.find(name, id);