comixed / comixed

The ComiXed Digital Comic Management System
GNU General Public License v3.0
213 stars 37 forks source link

Ability to filter by number of pages in a book so that single-page books can be easily identified and removed #2217

Open cjil opened 2 days ago

cjil commented 2 days ago

Is your feature request related to a problem? Please describe. In my collection there are a number of single-page books (variant edition covers) which I do not want or need. Currently it is required to click the checkbox next to each issue which can be time consuming.

Describe the solution you'd like I would like to be able to filter to easily identify books with only 1 page so that they can be quickly and easily removed. A better solution would be to be able to merge the files so that the variant covers were within the main book as well.

Describe alternatives you've considered

  1. I ran a manual SQL command to identify them all and mark them as deleted.

    begin; 
    update comic_details set comic_state = 'DELETED' where comic_book_id in (select comic_book_id from (select distinct on (c.comic_book_id) c.comic_book_id, c.series, c.volume, c.issue_number, count(*) over (partition by c.comic_book_id) as pages from comic_details as c inner join comic_pages as p on p.comic_book_id = c.comic_book_id) where pages = 1);
  2. Then to delete the files, I set the SQL client to output to a file. Since I am using Postgres as my database server, the command is:

    \o delete.txt
  3. Select the filenames where the comic_state is 'DELETED'

    select filename from comic_details where comic_state='DELETED';
  4. I then edited this file to remove the header and footer so it only contained the filenames

  5. I moved the file onto the Comixed app docker container, and executed the following command to delete the files from the system

    while read p; do rm "$p"; done < delete.txt
  6. Lastly, I removed the items that had been marked for deletion from within the Comixed app

mcpierce commented 2 days ago

Would sorting the list of comics by page, ascending, be sufficient to find comics with only a single page?

cjil commented 2 days ago

That does work, however due to the delay between selecting a checkbox and being able to select the next one, this is rather time consuming.

A filter allows to "select all" which does not have the same delay.

Alternatively, if the delay can be removed (I assume it is waiting for the ajax query response before allowing the next one to be selected) that would also assist.