From d4ef626961f1a9464dbdfc6761ead734a033c961 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Sun, 17 Nov 2024 14:51:03 -0500 Subject: [PATCH 1/2] datastore: gcode command storage fix Signed-off-by: Eric Callahan --- moonraker/components/data_store.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moonraker/components/data_store.py b/moonraker/components/data_store.py index 739cf38a..2f74b22e 100644 --- a/moonraker/components/data_store.py +++ b/moonraker/components/data_store.py @@ -160,7 +160,8 @@ def _store_gcode_command(self, script: str) -> None: if not cmd: continue self.gcode_queue.append( - {'message': script, 'time': curtime, 'type': "command"}) + {'message': cmd, 'time': curtime, 'type': "command"} + ) async def _handle_gcode_store_request(self, web_request: WebRequest From ccfe32f2368a5ff6c2497478319909daeeeb8edf Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Sun, 17 Nov 2024 15:18:32 -0500 Subject: [PATCH 2/2] datastore: store multiline commands as one entry Signed-off-by: Eric Callahan --- moonraker/components/data_store.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/moonraker/components/data_store.py b/moonraker/components/data_store.py index 2f74b22e..3153a3ca 100644 --- a/moonraker/components/data_store.py +++ b/moonraker/components/data_store.py @@ -155,12 +155,9 @@ def _update_gcode_store(self, response: str) -> None: def _store_gcode_command(self, script: str) -> None: curtime = time.time() - for cmd in script.split('\n'): - cmd = cmd.strip() - if not cmd: - continue + if script.strip(): self.gcode_queue.append( - {'message': cmd, 'time': curtime, 'type': "command"} + {'message': script, 'time': curtime, 'type': "command"} ) async def _handle_gcode_store_request(self,