komga icon indicating copy to clipboard operation
komga copied to clipboard

A way to view the trash can and selectively empty it

Open sxales opened this issue 3 years ago • 12 comments

Is your feature request related to a problem?

There is no easy way to see everything that it is in the trash and the only option is empty all of it or none of it.

Describe the solution you'd like

It would be nice if there was a view (like the Media Analysis tab) where you could see a list of all the items in the trash and choose individually whether to remove them or not.

sxales avatar Jul 29 '21 20:07 sxales

Can you clarify what this will help you achieve, and what kind of use case that would serve?

gotson avatar Jul 30 '21 02:07 gotson

I had a similar thought. I don't necessarily need the ability to selectively clear items from trash, but it would be useful to at least see what series have items in the trash.

Scenario (from yesterday): I replace some books in various series, and make some other modifications. I know that the books I replaced should all show up as new books, so I can use existing features of the WebUI to find those recently updated series, copy the metadata from old version of book to new version, and repeat. The problem I experience: I don't know if the only books unavailable are the ones I had replaced (or if something else in addition to my replacements happened), and I can't mark my progress by deleting my intentionally-unavailable books as I work through them.

This would also help if some or all of my library was lost from the server due to filesystem issues (a failed, rather than disconnected drive), as an indicator for what series had books in the trash would show me if I had managed to restore everything.

It would also generally serve to offer peace of mind. When I empty the trash on my computer, I can peruse the list of items to be erased before doing so.

kiriya-aoi avatar Jul 30 '21 18:07 kiriya-aoi

@kiriya-aoi for upgrading books you should use the import feature. It will automatically :

  • import the new book
  • copy the metadata, read progress, readlist from the book to upgrade
  • delete the old file and old book without using the trash

gotson avatar Jul 31 '21 00:07 gotson

Fundamentally, without a view to see what is in the trash, there is no way of knowing what you will be emptying absent going through every series in the library to check availability. This is obviously time consuming and if you have a large library, not particularly practical as well as prone to error since it is easy to miss an item. Also since there is no way to see that the trash even has items in it, the first time you are alerted to unavailability is when you go to read a series that is unavailable. Which from a user standpoint can be aggravating.

Secondly, there are a number of reasons why something might end up in the trash: filesystem problems, network share unavailability, series/file was manually deleted or moved., etc . . . some are temporary and some might not be. But since the trash can only be deleted as one single block you either have to resolve all of the temporary issues before the trash can be emptied (which might not be possible at that time and is a non-obvious task because there is no list of what is in the trash) or just empty everything (which more or less defeats the purpose of having a trash).

I can also imagine a scenario where I temporally remove a series from my library such as when swapping between hot and cold storage and it would be nice to be able to carry it in the trash for a while.

sxales avatar Aug 04 '21 20:08 sxales

Gotson would it be easy to add a filter on the series/book views that could be toggled and show items marked as unavailable. I would imagine that might solve most of the use cases, at least initially.

Kussie avatar Aug 06 '21 00:08 Kussie

Gotson would it be easy to add a filter on the series/book views that could be toggled and show items marked as unavailable. I would imagine that might solve most of the use cases, at least initially.

I see 2 use cases:

  1. Don't want to see the unavailable items in the views, but also don't want to empty the trash. Not a real use case, should enable auto-empty trash.
  2. The use case presented above, which is going through deleted items one by one to make sure nothing was deleted inadvertently. This is valid, and should warrant a dedicated view, because the current view, even with a filter, would not allow to see all deleted books for example, because they are contained in their own series.

gotson avatar Aug 06 '21 01:08 gotson

Secondly, there are a number of reasons why something might end up in the trash: filesystem problems, network share unavailability, series/file was manually deleted or moved., etc . . . some are temporary and some might not be. But since the trash can only be deleted as one single block you either have to resolve all of the temporary issues before the trash can be emptied (which might not be possible at that time and is a non-obvious task because there is no list of what is in the trash) or just empty everything (which more or less defeats the purpose of having a trash).

A completely unavailable filesystem or network share would mark everything unavailable, you would probably notice it quickly. That is independent of you usually.

If you manually moved or deleted files, you probably know that you did, and if they have been moved/renamed, then the scan would have detected that they have the same hash, and restored them. They would not be unavailable anymore.

I can also imagine a scenario where I temporally remove a series from my library such as when swapping between hot and cold storage and it would be nice to be able to carry it in the trash for a while.

That's an edge case i wouldn't want to support explicitly, but if it works for you, why not.


In terms of screen to view the content of the trash, what would best suit you ?

I was thinking of a table similar to media analysis, available only for admins, in the Server Settings. I would probably split the table in 2, one for Series and one for Books. As for the information displayed, i was thinking:

  • complete file path
  • title (from the metadata)
  • time of deletion

Would that make sense?

gotson avatar Aug 06 '21 01:08 gotson

A temporary measure would be to search for deleted:true

gotson avatar Sep 23 '21 14:09 gotson

or even a tick box in the filter.

elit3ge avatar Sep 30 '21 04:09 elit3ge

or even a tick box in the filter.

the temporary measure above works as of now

gotson avatar Sep 30 '21 06:09 gotson

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Dec 30 '21 01:12 github-actions[bot]

I would also find this feature useful. My usecase is that I am reorganizing Series in my library and running a deep scan after the moves.

It would be nice to have a single place where I can view all Series in a specific Library that are Unavaliable. I can then check this page after the Deep Scan Runs to ensure all of the Series have been migrated correctly

austin-joseph avatar Dec 31 '23 00:12 austin-joseph