fraschetti / Octoslack

OctoPrint plugin for Slack, Mattermost, Pushbullet, Pushover, Rocket.Chat, Discord, Riot/Matrix, & Microsoft Teams
MIT License
74 stars 34 forks source link

[feature request] thunbnail from gcode #85

Open JFSolution opened 4 years ago

JFSolution commented 4 years ago

Include thumbnail from gcode in print started message

Here is how to include a thumbnail in gcode: https://plugins.octoprint.org/plugins/prusaslicerthumbnails/

jneilliii commented 4 years ago

@fraschetti Both the PrusaSlicerThumbnails plugin and the UltimakerFormatPackage plugin utilize the same approach for thumbnails. They both add thumbnail and thumbnail_src metadata properties to the files, which is returned by the file API, and also accessible via self._file_manager.get_metadata("local", ) calls in Python if I'm not mistaken.

In both cases the URL is a relative URL to the png image.

charles4308 commented 4 years ago

@fraschetti I think if you can store a second variable with the file name, without the '.gcode' at the end, this would work as a quick fix.

Ultimaker Preview Url: http:///plugin/UltimakerFormatPackage/thumbnail/.png

I think your {print_name} variable contains the file extenstion.

If this were changed, i would could replace in the url with your stored variable.

here is an example when i manually enter the URL: image