From 9df23cab625d483f8746658d376d4607b10d2f11 Mon Sep 17 00:00:00 2001 From: Ian Chua Date: Fri, 4 Sep 2026 14:59:53 +0800 Subject: [PATCH] fix: opc updates being discarded --- src/slic3r/Utils/PresetUpdater.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index d05c7b9586..017deb0fc9 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -780,11 +780,15 @@ void PresetUpdater::priv::sync_vendor_config(const std::string& vendor_id) const fs::path cached_vendor_json = cache_profile_path / (vendor_id + ".json"); const fs::path cached_vendor_folder = cache_profile_path / vendor_id; - if (!fs::is_regular_file(cached_vendor_json) || !fs::is_directory(cached_vendor_folder) || - fs::is_empty(cached_vendor_folder)) { + + const fs::path cached_vendor_opc = cache_profile_path / (vendor_id + ".opc"); + + bool is_json_update = fs::is_regular_file(cached_vendor_json) && fs::is_directory(cached_vendor_folder) && !fs::is_empty(cached_vendor_folder); + bool is_opc_update = fs::is_regular_file(cached_vendor_opc); + if (!is_json_update && !is_opc_update) { BOOST_LOG_TRIVIAL(warning) << "[Orca Updater] rejected update for " << vendor_id << ": expected " << vendor_id << ".json and a non-empty " - << vendor_id << " directory"; + << vendor_id << " directory, or OPC update format."; fs::remove_all(cached_vendor_folder, ec); fs::remove(cached_vendor_json, ec); return;