Coder Social home page Coder Social logo

Comments (7)

unclej84 avatar unclej84 commented on July 28, 2024

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

from octoprint-webhooks.

derekantrican avatar derekantrican commented on July 28, 2024

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

from octoprint-webhooks.

derekantrican avatar derekantrican commented on July 28, 2024

@2blane Any insight on this?

from octoprint-webhooks.

2blane avatar 2blane commented on July 28, 2024

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.

from octoprint-webhooks.

derekantrican avatar derekantrican commented on July 28, 2024

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)

from octoprint-webhooks.

derekantrican avatar derekantrican commented on July 28, 2024

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

from octoprint-webhooks.

derekantrican avatar derekantrican commented on July 28, 2024

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:

  • the get_job_information method has some better fallback for getting this information
  • the payload of the PrintDone event is used for @job instead

Thoughts?

from octoprint-webhooks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.