mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Prevent printer from being added twice if it's in cloud and local
CURA-7055
This commit is contained in:
parent
33b3bb77c3
commit
d1337c9e22
1 changed files with 5 additions and 2 deletions
|
@ -120,8 +120,11 @@ class CloudOutputDeviceManager:
|
|||
for cluster_data in clusters:
|
||||
device = CloudOutputDevice(self._api, cluster_data)
|
||||
# Create a machine if we don't already have it. Do not make it the active machine.
|
||||
meta_data = {self.META_CLUSTER_ID: device.key}
|
||||
if CuraApplication.getInstance().getMachineManager().getMachine(device.printerType, meta_data) is None:
|
||||
machine_manager = CuraApplication.getInstance().getMachineManager()
|
||||
|
||||
# We only need to add it if it wasn't already added by "local" network or by cloud.
|
||||
if machine_manager.getMachine(device.printerType, {self.META_CLUSTER_ID: device.key}) is None \
|
||||
and machine_manager.getMachine(device.printerType, {self.META_NETWORK_KEY: cluster_data.host_name + "*"}) is None: # The host name is part of the network key.
|
||||
new_devices.append(device)
|
||||
|
||||
if not new_devices:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue