fix(preset): filament_id für User-Presets generieren wenn keine P-Prefix-ID vorhanden

This commit is contained in:
viewit
2026-06-03 11:10:04 +02:00
parent f832fb2d4d
commit 3c291f8883

View File

@@ -644,9 +644,13 @@ void Preset::save(DynamicPrintConfig* parent_config)
// no filament_id which caused AMS sync to fall back to the parent's Generic ID.
// Also generate a new ID if filament_id is inherited from the parent (== base_id).
// This happens when a user preset is saved for the first time without having its own ID.
// A user preset needs its own filament_id if:
// - it has no filament_id at all, OR
// - its filament_id does not start with "P" (user preset IDs start with "P",
// system IDs start with GFL/OGFL/GFA/etc.)
bool needs_unique_filament_id = this->is_user() && !this->name.empty() &&
this->type == Preset::TYPE_FILAMENT &&
(this->filament_id.empty() || (!this->base_id.empty() && this->filament_id == this->base_id));
(this->filament_id.empty() || this->filament_id.front() != 'P');
if (needs_unique_filament_id) {
boost::uuids::detail::md5 hash;
boost::uuids::detail::md5::digest_type digest;