Skip invalid vendors

This commit is contained in:
ExPikaPaka
2026-08-05 21:14:55 +08:00
committed by SoftFever
parent ff92efa91f
commit d85b555748
+6 -1
View File
@@ -90,6 +90,7 @@ int main(int argc, char* argv[])
int saved = 0, failed = 0;
for (const auto& vendor_name : vendor_names) {
try {
const std::string json_path = (fs::path(profiles_path) / (vendor_name + ".json")).string();
const std::string ver_str = get_vendor_cache_key(json_path);
@@ -104,7 +105,7 @@ int main(int argc, char* argv[])
// Verify the file was written and can be reloaded.
Slic3r::PresetBundle::VendorCache verify;
if (!verify.load(cache_path) || !verify.is_valid(ver_str)) {
std::cerr << "WARNING: verification failed for " << cache_path << "\n";
std::cerr << "ERROR: " << vendor_name << ": verification failed\n";
++failed;
} else {
std::cout << " [ok] " << vendor_name << ".cache"
@@ -116,6 +117,10 @@ int main(int argc, char* argv[])
total_printer += vc.printer_presets.size();
++saved;
}
} catch (const std::exception& ex) {
std::cerr << "ERROR: " << vendor_name << ": " << ex.what() << "\n";
++failed;
}
}
std::cout << "\nDone: " << saved << " cache(s) written";