New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #2949: Sample image replacement ability #3015
Conversation
Can this be tested for a while on a test system first. IMO deleting files is huge, and it'd be wise to iron out as many kinks as possible before these commits go live. |
I have it running on http://feat-replace-images.devbooru.ml. login: Deleting the old files isn't strictly necessary. Actually I don't think it would hurt to keep them, beyond leaving some loose files on the server and wasting a little disk space. I don't know how albert feels about that though, so I set it to delete the old files in a delayed job three days later. The grace period could be extended if we want. If there's a mistake, the mod action has a link to the old file still on the server, so it's possible to redownload it before it's deleted. It should also be possible to cancel the delayed job to prevent the deletion, although that would need albert's intervention. It would be possible too to have the delayed job list which files it's going to delete, although I didn't do this. |
Hm, the feature itself is pretty nice, but given the amount of samples and the fact that only mods can replace the images, I feel that some sort of request system will soon be necessary as well. Maybe it can be handled using the forums, but it'll probably get clunky. |
While it’s a bit inconsistent to all the other permissions, could sample replacement be allowed for users that are builder+ and have approval right? That way, it wouldn’t be possible to replace samples for regular users and non-approvers. Currently, we have 38 builders with approval rights out of 604 builders in total. |
I did some initial testing on this. I left my findings on the Danbooru forums. |
I'll respond more fully on the forum. I agree with most of this, but I wanted to keep the first pass simple and see what albert thinks before going too far ahead with it. |
|
I think we'd have to keep doing what we currently do: delete the old sample and move the favorites to the parent (related: #2936). Going forward, we might want something on the upload page directing people to replace samples so that they don't keep uploading things that should be replaced instead.
IMO mod actions don't need to be pruned as aggressively as they are. We're at id 177063, which is really not that much even if nothing was deleted. At the least, the pruner could only prune the least important things.
30 days is fine by me. What I was thinking was that jobs in the
I thought about this and basically I think that flags, appeals, approvals, and disapprovals could possibly be unified into a single post events STI table. These things all have very similar schemas and share a fair amount of duplicated code. Post replacements could be a part of that system, as they'd just be another kind of event in a post's history. |
#3030 is an attempt at this. It would backup files to S3 immediately on post creation/replacement, instead of in a cronjob. What do you think of that approach? |
I've added the model in 78b08d8. |
Fixes #2949. Adds the ability to replace the image file of an existing post.
Some corner cases are not handled yet and so are disallowed: