Closed WildRikku closed 2 weeks ago
I think I figured it out. Octoprint does some processing of uploaded files. When the files are large, this can take several seconds. You can tell by the dropdown arrow being faded out directly after upload and becoming usable after a moment. Once it's usable, the problem never occurs when clicking "load and print". So, a workaround is to wait. SpoolManager might be able to wait until the file is processed though before it throws an error. One could also argue that Octoprint should not load the file if it's not processed yet.
While Octoprint updates the estimated time when the file has been processed, SpoolManager does not update the filament amount needed, so it should react to the end of the processing. You can see that when uploading a huge file and loading it. The status section of Octoprint will show almost nothing at first, but when the file is processed, it will be updated.
Installing PrintTimeGenius "solves" the issue for some users because it speeds up the calculation of the needed filament significantly.
Since processing an uploaded file can take a significant amount of time, just waiting with no notice is not an option. I opted for making the warning more precise so users can tell that they have to wait for the file. The issue of the filament usage not updaing in the status section is still to be solved though.
When clicking "load & print" from a file, sometimes, the filament amount is not calculated and the according error is displayed. It is always fixed by loading a different file, loading the file again and then starting the print. The problem sometimes also occurs when just loading the file. It might be related to uploading a file as I always have the problem with files I just uploaded.