diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index da58564a..5c168cda 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -300,7 +300,7 @@ default_settings = { "okWithLinenumber": False, "numExtruders": 1, "includeCurrentToolInTemps": True, - "includeFilenameOnOpened": True, + "includeFilenameInOpened": True, "movementSpeed": { "x": 6000, "y": 6000, diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 27181edb..fd3b3090 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -1140,12 +1140,16 @@ class MachineCom(object): elif 'File opened' in line and not self._ignore_select: # answer to M23, at least on Marlin, Repetier and Sprinter: "File opened:%s Size:%d" match = regex_sdFileOpened.search(line) + if match: + name = match.group("name") + size = int(match.group("size")) + else: + name = "Unknown" + size = 0 if self._sdFileToSelect: name = self._sdFileToSelect self._sdFileToSelect = None - else: - name = match.group("name") - self._currentFile = PrintingSdFileInformation(name, int(match.group("size"))) + self._currentFile = PrintingSdFileInformation(name, size) elif 'File selected' in line: if self._ignore_select: self._ignore_select = False