Open alucicrazy opened 12 months ago
Um, that functionality is the sole Purpose of Clean. What else you think it does?
Maybe we just need a better warning, or a safety lock to prevent users like you mention from running clean (Warning. Danger, you have fileless metadata that will be deleted if you proceed, are you SURE you want to do this?)
I've had ideas to improve the Clean task by adding toggles to configure its behaviour, so for example one of them could be "Delete linked scenes/galleries/images" which if unchecked would leave file-less objects rather than deleting the objects as well. This might cause issues with file-less images though, since that isn't properly supported everywhere.
That would then allow for additional functionality in the Clean task, like removing stale blobs (#3601) or deleting unused generated files. These two could probably be separate tasks, but I think it would be nice to have one task to remove all the cruft from an entire system.
That label "Delete linked scenes/galleries/images" would scare the heck out of me, and I'd expect it to delete all of my library. Please don't use that text.
That label "Delete linked scenes/galleries/images" would scare the heck out of me, and I'd expect it to delete all of my library. Please don't use that text.
Maybe that's a good thing, enabling that should scare you :) But yeah the exact naming is of course subject to change.
"Delete file-less scenes/galleries/images" is perhaps better, but that implies that it will delete all file-less objects, rather than just deleting those that are now file-less due to the Clean task having deleted their files (i.e. what I believe Clean does currently, although I haven't ever actually used the Clean task myself so maybe it doesn't do that)
Maybe my description was not really clear, but I want a way to keep the scenes that had files but were deleted, and just delete the file-scene association instead of removing the whole scene from Stash
@alucicrazy My improvement would allow exactly that yes, if you disable the "Delete linked scenes/galleries/images" toggle. The Clean task would then only be removing the files in your database that no longer exist on disk, without removing the scenes/galleries/images they belong to.
Putting this here because I don't consider it an independent feature request, or a bug.
But one small nitpick that I have is that clean doesn't consider the hash of compressed files before crawling their content. I know it isn't setup to evaluate the compressed file as anything but a directory, but this could potentially save hours of waiting for the script to traverse unchanged zip files.
@smegmarip I have noticed that yes, and it would give a nice performance improvement for those with many zip galleries (such as myself). When I get around to the improvement I mentioned above, I'll definitely try and add that in. I'll also probably add in an option to force-traverse zip files similar to #4113, for if you want to be extra thorough.
Is your feature request related to a problem? Please describe. The current "Clean" task in the Stash app removes scenes from the database when their associated video files are missing. This results in the loss of valuable scene metadata, which can be frustrating for users who prefer to retain scene organization and metadata even when video files have been removed.
Describe the solution you'd like I would like to propose an enhancement that includes a user-friendly toggle or option for the "Clean" task. This toggle would allow users to choose whether they want to unlink video files from scenes when the files are missing, rather than deleting the entire scene. By providing this toggle, users can preserve their scene organization and metadata.