From 25302a4ae6e851438fcce6a20153ff39105e3df9 Mon Sep 17 00:00:00 2001 From: bbeaulant Date: Mon, 2 Aug 2021 19:46:53 +0200 Subject: [PATCH] ~ Importer material name strip refactor --- .../ruby/worker/importer/importer_import_worker.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ladb_opencutlist/ruby/worker/importer/importer_import_worker.rb b/src/ladb_opencutlist/ruby/worker/importer/importer_import_worker.rb index 8d6e5fe89..b5fad214b 100644 --- a/src/ladb_opencutlist/ruby/worker/importer/importer_import_worker.rb +++ b/src/ladb_opencutlist/ruby/worker/importer/importer_import_worker.rb @@ -93,9 +93,10 @@ def run # Retrieve material (or create it) material = nil unless part[:material].nil? - material = materials[part[:material].strip()] + material_name = part[:material].strip + material = materials[material_name] unless material - material = materials.add(part[:material].strip()) + material = materials.add(material_name) material.color = MATERIALS_PALETTE[material_palette_index] material_palette_index = (material_palette_index + 1) % MATERIALS_PALETTE.length end