diff --git a/custom_components/moonraker/__init__.py b/custom_components/moonraker/__init__.py index 9caf175..ece4454 100755 --- a/custom_components/moonraker/__init__.py +++ b/custom_components/moonraker/__init__.py @@ -206,6 +206,11 @@ async def _async_get_gcode_file_detail(self, gcode_filename): try: # Keep last since this can fail but, we still want the other data path = gcode["thumbnails"][len(gcode["thumbnails"]) - 1]["relative_path"] + thumbnailSize = 0 + for t in gcode["thumbnails"]: + if t["size"] > thumbnailSize: + thumbnailSize = t["size"] + path = t["relative_path"] return_gcode["thumbnails_path"] = os.path.join(dirname, path) return return_gcode