tuub / kitodo-mediaserver

Kitodo Mediaserver
GNU General Public License v3.0
7 stars 6 forks source link

Delete work #294

Open ponchofiesta opened 5 years ago

ponchofiesta commented 5 years ago

I think we talked about it. Should there be a way to delete a work? Actually the user would need to delete a work manually from the DB and filesystem.

I assume this could be done with an action.

pbroman commented 5 years ago

That would probably be a relatively simple action, something similar to the cache delete action. But I'm afraid, this case is a bit more complex. If we add it to the ui, we must extend the ui with a warning "You are about to ... This cannot be undone...". Otherwise, you might accidentally delete a lot of works. Maybe we should then also add a deleted flag to the work table, otherwise, there will be no possibility to know, which works were deleted. And should the search then display deleted works or not? I suppose, you must have a possibility to select that. And if a work with the same ID is imported later, the deleted flag has to be unset. ...

ponchofiesta commented 5 years ago

I also think now an action is the wrong way. Normally before and after performing an action the work is still available. Otherwise performRequested() would throw an error. Of cause, if you keep this in mind, it would work with performImmidiately().

Perhaps a place would be WorkService.deleteWork(). Than we need a CLI command and an UI method of taking care of this dangerous step.