Reset successfully printed files

What is the problem?

I organized my prints in directories, very nice to see the color of a file is turned into green when printed.
Now I want to print the whole thing again, but all files are green already.
How can I reset them to be "not printed" again ?

What did you already try to solve it?

Tried file-manager, looked for options, found nothing.

Have you tried running in safe mode?

No.

Did running in safe mode solve the problem?

No.

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!)
octoprint-systeminfo-20240726151941.zip (37.8 KB)

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

OctoPrint
Version 1.10.2

OctoPi
Version 1.0.0, running on Raspberry Pi 4 Model B Rev 1.4

Anet A8 Marlin 1.1.8

Chrome

Win 11

Hello @HinkePank !

Just click the Load icon

grafik

and the Print

or the Load & Print icon on the right of it

Hi Ewald,

in this way I can start the print again - clear.
But I want all files in the directory to look like they haven't been printed before.

It is so helpful to have the overview which of the files are already printed.

But if they have been printed one, they appear always like beeing printed. So I
lost the overview when I want to print the files afain.

Sorry id I haven't described my issue correctly in my first posting.

Regards
Harald

You want to change / delete history section of the meta data for the file manager.

The file named: ".metadata.json"

It should be in the root of where you upload your file to. You can find this buy looking at your settings in OctoPrint and finding the section named "Folders" on the left. At the top there is the upload folder path.

Each file has an entry in there that has a section and in that section there is a history node that looks like this:

{
        "timestamp": 1683984513.3256207,
        "printTime": 80.78099999998813,
        "success": true,
        "printerProfile": "kp3"
      },
      {
        "timestamp": 1683984535.932572,
        "success": false,
        "printerProfile": "kp3"
      },

It should be as simple as deleting the history for your file.

I would make a backup before you make any changes. I am pretty sure if you mess up the format of this you will be sorry.

You maybe just want to leave the history and change all of the success true to false. Should solve your challenge and be the least disruptive.

Not sure how to get it to reload. Likely you will just need to do a hard refresh.

Another option would be to re-upload all the files. I'm pretty sure that will reset the metadata for them. It would be possible to create a plugin to clear the metadata information, and in your case it would probably make the most sense to perform that action at the folder level with a button or something in the UI like this.

image

Hi,

yes re.upload would do exaclty what I want to get - but it is a bit of effort I wanted to avoid.

A plugin which does the work on folder-level would be ideal.

And - yes also : I tried to replace the "success": true with "success": false .
First nothing happened, even reload the folder-view in octoprint did not change anything.

Well it changed after restarting complete octoprint : All ( also the directories and files on upper levels ) are gone. The file-view is completely empty now.

In the filesystem they are still there - I created a terrible mess obviously :frowning: .

Ok, I have something to do now....

Ok... well the back up would have been a good idea. Hope you did that. If not, maybe you can have it use polling to correct itself.

image

But more likely the issue is that you somehow broke the json formatting for the nodes you replaced.
I did warn to make a back up :slight_smile:

Yes - it's the sad truth : "Experts" don't do backups if there a just small changes ....

I can't even create a new directory anymore - also not upload files.

Experts are born the hard way ( grown out of silly idiots like me )

Are they really gone or just hiding from OctoPrint???
At one time there was a bug in the DisplayLayerProgress plugin and the fix was to reload all the files after the plugin update to fix it. Not me!
I wrote a script that made a copy of the 'upload' folder and dumped it into the 'watched' folder. OctoPrint dutifully processed each file and re-analysed the files and put them into the directories they came from. Took a while, it's not fast.... but it was automatic.

I just ran across this function while looking into something else, which makes me believe clearing the history data in a plugin would be even easier. Would just have to pull metadata to get the indexes for each file in a loop and then call this via

self._file_manager._storage("local").remove_history(<path>, <index>)

You are right - the files ard still on the hd. ( I am using a SSD for the octopi )
Writing a little script sound like a great idea. Did you copy the directories ( the whole tree ) or
do you need to create them manually in octoprint before.
I assume you did not copy the .metadata.jason -files as I destroyed them.

Ooooh! I actually prettified it with a 'help' and everything... It rebuilds the directories too.
Correct, the metadata files are rebuilt by OctoPrint on the reload. Now I just have to find a way to get it to you.
Reload.zip (1.7 KB)
There are two options.

Usage: Reload.sh -c -d XX
     c - strip current DLP M117 messages
     d - delay between files