From d39c124f35b53a02b80134af28962fe26dc4b1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 2 Jun 2017 14:25:02 +0200 Subject: [PATCH] Allow empty & custom size in print job events Thanks to @erikheidstra for the heads-up --- src/octoprint/printer/standard.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py index 75e6798b..aa542858 100644 --- a/src/octoprint/printer/standard.py +++ b/src/octoprint/printer/standard.py @@ -1174,8 +1174,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): except: self._logger.exception("Error while trying to persist print recovery data") - def _payload_for_print_job_event(self, location=None, print_job_file=None, position=None): - print_job_size = None + def _payload_for_print_job_event(self, location=None, print_job_file=None, print_job_size=None, position=None): if print_job_file is None: with self._selectedFileMutex: selected_file = self._selectedFile @@ -1186,7 +1185,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): print_job_size = selected_file.get("filesize", None) location = FileDestinations.SDCARD if selected_file.get("sd", False) else FileDestinations.LOCAL - if not print_job_file or not print_job_size or not location: + if not print_job_file or not location: return dict() if location == FileDestinations.SDCARD: