Closed derekantrican closed 4 years ago
Hi,
has this been using the test of the webhook or after a real print / dry-run? For test mode the filename is set to "None" - even if you have a file selected before.
Regards Jörg
No, this is for real prints. In fact, when I do a test webhook event I don't get "None" - I get the previously selected print name
@2blane Any insight on this?
The information isn't always provided. This plugin grabs as much info as it can from OctoPrint but a lot of fields can be blank depending on if OctoPrint gives us the data. If this is a recurring problem I will reopen, but for now I'd suggest try uploading and starting your job in different ways if possible to see if you can get the name field to fill out.
The name field is fine when it starts printing (I have another webhook for that) - it's just when it finishes printing that it doesn't have the name. So I'm not sure how a different method of uploading will fix this (in fact - I've tried multiple different ways of uploading - even just reprinting from OctoPrint's history all with the "None" name result in the print finished event)
It's been a long time (almost exactly a year) but this is definitely a recurring problem. It happens every time I print and I haven't been able to figure out an easy solution. Recently I've had more time and I've been working on a PR for #17 and may have time to look into this.
In the meantime, it seems that when the Print Done event is fired, the "job" payload is all null:
{
"file": {
"name": null,
"path": null,
"display": null,
"origin": null,
"size": null,
"date": null
},
"estimatedPrintTime": null,
"averagePrintTime": null,
"lastPrintTime": null,
"filament": null,
"user": null
}
Any idea why this might be? Is anyone else seeing the same?
As a workaround it seems like I might be able to use @extra.name
so I'll test that out
A little bit more digging:
It seems that @job
has many null (or None) values because @job
comes from self._printer.get_current_data()
. At the time of the PrintDone event, that returns the values in the comment above. However, the PrintDone event's payload (@extra
) has the info needed.
I would suggest that either:
get_job_information
method has some better fallback for getting this information@job
insteadThoughts?
If I use the following message for the PRINT DONE event:
I get a message like "None finished printing".
What is the correct parameter to use when getting the file name of a finished print?