AlexVerrico / octoprint-stats

Stats for your octoprint instance. Mirrored from https://github.com/amsbr/OctoPrint-Stats originally
15 stars 8 forks source link

Stop double counting cancelled prints and move database location #8

Closed Menace-Dennis closed 3 years ago

Menace-Dennis commented 3 years ago

I'm still getting used to GitHub, I didn't realise a pull request would keep updating with changes to the branch until approved, so creating a new pull request hahaha

When a print is cancelled, in stats this is counted as both "Cancelled" and "Failed". It should be one or the other really. Personally, in my fork, I chose to save the "Failed" status for prints that stopped because of errors. I then moved the "Error" category to the connection stack as this included errors that didn't also stop a print. This way the "Complete" + "Cancelled" + "Failed" is the same height as started.

Additionally, moved the database location to the data folder so that its included in backups.

Tested on Python3, OctoPrint 14.2

AlexVerrico commented 3 years ago

Hi @Menace-Dennis Have you added any checks/methods to migrate the database from the old location? Cheers, Alex.

Menace-Dennis commented 3 years ago

Hi @AlexVerrico, Yep, I've highlighted the lines that do that :) Cheers

AlexVerrico commented 3 years ago

Hi @Menace-Dennis Great, I do plan to merge these changes, but I'll have to do some checks on python 2 first. It may take a week or two, but it will happen 😉 Cheers, Alex.

Menace-Dennis commented 3 years ago

Haha, fair enough