From 56c387502acd93cca49d173229549babf39594b9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 16 Mar 2020 15:54:41 +0100 Subject: [PATCH] Strip extension from file_name when printing via the cloud ST-2880 --- plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py index b544490cfb..df8c220472 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py @@ -1,6 +1,7 @@ # Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from time import time +import os from typing import List, Optional, cast from PyQt5.QtCore import QObject, QUrl, pyqtProperty, pyqtSignal, pyqtSlot @@ -191,8 +192,9 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice): def _onPrintJobCreated(self, job: ExportFileJob) -> None: output = job.getOutput() self._tool_path = output # store the tool path to prevent re-uploading when printing the same file again + file_name = job.getFileName() request = CloudPrintJobUploadRequest( - job_name=job.getFileName(), + job_name=os.path.splitext(file_name)[0], file_size=len(output), content_type=job.getMimeType(), )