-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
✨ Add delete media functionality #502
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
🚨 Try these New Features:
|
There are two big things I'd like to touch on before digging into this feature: Deletion from the perspective of the DB vs deletion of files directly I'll create explicit sections to better organize my thoughts Deletion (DB)It isn't actually used today, but media records do have a This does have some implications though, primarily that most queries would need to be refactored as to exclude any deleted books by default. I thought I had more to discuss here, but I'm coming up blank. I think the section below is more relevant to the conversation at hand, and it touches on the tentative interactions between the DB and file deletion. I'll leave this here for the useful links and move on Deletion (files)Originally, in the referenced issue, I expressed the preference for some kind of "trash" functionality:
I think this might be a more palatable first step into the deletion realm for users. Programmatic deletion is generally non-recoverable unless someone has their own backup system, which is somewhat scary. The elephant in the room is that "trashing" a file in Docker doesn't necessarily make sense. I think a viable route would be to implement some kind of custom trash system where:
I also think we need to add something like OK. Rant ended. All of this to say, I'm not entirely sure what the best combination of these deletion strategies is. A potentially helpful use-case to consider could be:
I can't enumerate all the potential use-cases, and this is just the first I could think of, but I think this is a good starting point for how I see it in my head at least. I'm okay making broad strokes / decisions here since, generally speaking, if people are actually using Stump they aren't very vocal about what they want vs definitely don't want. Once we land on a concrete path forward, I think we can move the more granular and implementation-specific conversation to Discord for convenience. But please let me know if you have any thoughts or differing opinions! I'm happy to discuss further |
Okay so the
|
They wouldn't have to rescan at all, assuming it is implemented as I described above:
So if I were to delete a book this way, the UI should refetch the current query which doesn't include the book anymore. Let me know if I'm not explaining that bit well
I don't see much difference in this scenario, but I do understand your point. The problem I see is that to accomodate this would mean two separate-ish code paths:
What would those relative time descriptors be? Should it be X minutes? Would Y minutes be too much? Etc. The UI would also need to present what would happen in the same manner, since there would be an inconsistency in what an action does between these two scenarios. If the difference wasn't there, it might be a little more tedious to empty the trash for an accidental upload for sure. If we can come up with acceptable definitions for these kinds of things and document them accordingly, I'd be okay with it though 🙂 |
This pull request addresses #110 by adding the requested feature.
I added a new endpoint to the api::v1::media::individual module that allows deletion of files by users with the
ManageLibrary
permission. The endpoint takes an optional query parameter to allow deletion of the underlying file.For the UI, I added a button to the management screen for deleting books. Clicking it opens a confirmation modal that allows a user to check a box to delete the underlying file.