Is there a way to reliably identify specific print job in the plugin?
When I was writing the event handler in my plugin, I realized that it'd be desirable to be able to correlate individual events by the print job. For instance, I'd like to know a
PrintFailed event is for the same print job as the
PrintCancelled event at some earlier point, and the
PrintResumed event at another point earlier.
I'm currently tracking these events using a pretty complicated logic but apparently I missed some of the corner cases. My users have reported mis-identified print jobs.
Ideally I'd want OctoPrint to track print job id and provide it to plugin, probably by adding an
id field to the return value of
plugin._printer.get_current_job(). Since OctoPrint controls the lifecycle of a print job, it should be able do it much more reliably than the patchy code in my plugin that tries to reverse-engineer the print job's lifecycle.
But I might have missed some API/field that already exits to provide this info.
Any help is really appreciated!