OllisGit / OctoPrint-PrintJobHistory

OctoPrint Plugin stores all print-job informations of a print in a database
139 stars 41 forks source link

**Thumbnails broken? READ THIS first** #227

Open dojohnso opened 8 months ago

dojohnso commented 8 months ago

https://github.com/OllisGit/OctoPrint-PrintJobHistory/pull/226 https://github.com/OllisGit/OctoPrint-PrintJobHistory/pull/214

Check out the fixes in the PR(s) (226 includes 214). The author of this repo doesn't seem to pay attention anymore but you can update the files manually per the steps I listed on those.

If they don't solve your issues, feel free to post a comment here and include the Technical Log from the print job history job having issues and I'll do my best to help.

RalfZi commented 8 months ago

No thumbnail by saving the print history but in the log is no error

`2023-11-01 20:24:32,886 - INFO - ----- Start grab Image/thumbnail... ----- 2023-11-01 20:24:32,905 - INFO - Try reading Thumbnail 2023-11-01 20:24:32,908 - INFO - Thumbnail is present 2023-11-01 20:24:32,909 - INFO - Thumbnail was captured from metadata 2023-11-01 20:24:32,910 - INFO - Try to take thumbnail, because afterprint/gcode not selected 2023-11-01 20:24:32,912 - INFO - Try reading Thumbnail 2023-11-01 20:24:32,916 - INFO - Try converting thumbnail '/home/pi/.octoprint/data/PrintJobHistory/../prusaslicerthumbnails/RODSLOTH_0.6n_0.2mm_PLA_MK3S_43m.png' to '/home/pi/.octoprint/data/PrintJobHistory/snapshots/20231101-193037.jpg' 2023-11-01 20:24:32,924 - INFO - Converting successfull! 2023-11-01 20:24:32,925 - INFO - Thumbnail was captured from metadata 2023-11-01 20:24:32,927 - INFO - ----- Start reading filament ----- 2023-11-01 20:24.

But an error in Octoprint log

2023-11-01 19:36:48,976 - octoprint - ERROR - Exception on /plugin/PrintJobHistory/printJobSnapshot/20231101-162600.jpg [GET] Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 2529, in wsgi_app response = self.full_dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(args, kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_PrintJobHistory/api/PrintJobHistoryAPI.py", line 443, in get_snapshot return send_file(absoluteFilename, mimetype='image/jpg', cache_timeout=1) TypeError: send_file() got an unexpected keyword argument 'cache_timeout' 2023-11-01 19:36:49,053 - octoprint - ERROR - Exception on /plugin/PrintJobHistory/printJobSnapshot/20231101-054800.jpg [GET] Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 2529, in wsgi_app response = self.full_dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/oprint/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/init.py", line 1686, in wrapper return f(args, kwargs) File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_PrintJobHistory/api/PrintJobHistoryAPI.py", line 443, in get_snapshot return send_file(absoluteFilename, mimetype='image/jpg', cache_timeout=1) TypeError: send_file() got an unexpected keyword argument 'cache_timeout' 2023-11-01 19:36:49,101 - octoprint - ERROR - Exception on /plugin/PrintJobHistory/printJobSnapshot/20231026-092900.jpg [GET] Traceback (most recent call last):

RalfZi commented 8 months ago

I fix the error in correct line 443 in PrintJobHistoryAPI.py to return send_file(absoluteFilename, mimetype='image/jpg' ) greetings

ezi00 commented 8 months ago

I fix the error in correct line 443 in PrintJobHistoryAPI.py to return send_file(absoluteFilename, mimetype='image/jpg' ) greetings

thanks worked for me as well..

Filmman586 commented 7 months ago

Will an update be coming anytime soon?

dojohnso commented 7 months ago

anyone who sees this and the PRs mentioned above haven't been merged yet, please head over to this issue and comment on it to try and convince OctoPrint that this plugin has been abandoned. Cheers!

https://github.com/OctoPrint/plugins.octoprint.org/issues/1222

/cc @Filmman586

dojohnso commented 7 months ago

I fix the error in correct line 443 in PrintJobHistoryAPI.py to return send_file(absoluteFilename, mimetype='image/jpg' ) greetings

I'm glad it worked for you! Did you happen to see the change in this PR that changes the cache_timeout parameter to max_age? Just curious if that would've worked as well. Sounds like the change you made is an alternate approach to the same bug.

Filmman586 commented 7 months ago

I have no way of editing the file, can I get the file already fixed?

Hottabych- commented 7 months ago

I have no way of editing the file, can I get the file already fixed? Don't understand, because if you can exchange the file then you can edit your local file too e.g. with nano oder vi. As you can read in several sources it is a very simple fix. Look at https://github.com/OllisGit/OctoPrint-PrintJobHistory/issues/218#issuecomment-1584347340 alternativ https://github.com/OllisGit/OctoPrint-PrintJobHistory/pull/226

Filmman586 commented 7 months ago

Thank you! I did I’ll give it a try!

Sent from my iPhone 6 Plus

On Nov 26, 2023, at 12:23 PM, Hottabych- @.***> wrote:



I have no way of editing the file, can I get the file already fixed? Don't understand, because if you can exchange the file then you can edit your local file too e.g. with nano oder vi. As you can read in several sources it is a very simple fix. Look at #218 (comment)https://github.com/OllisGit/OctoPrint-PrintJobHistory/issues/218#issuecomment-1584347340 alternativ #226https://github.com/OllisGit/OctoPrint-PrintJobHistory/pull/226

— Reply to this email directly, view it on GitHubhttps://github.com/OllisGit/OctoPrint-PrintJobHistory/issues/227#issuecomment-1826840874, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AT3LHWTTVQS3EZC5SM5RNWDYGN3JRAVCNFSM6AAAAAA6H2OTMKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWHA2DAOBXGQ. You are receiving this because you were mentioned.Message ID: @.***>

dojohnso commented 7 months ago

WE DID IT - i now control this plugin and have pushed the update. thanks everyone!