Enma icon indicating copy to clipboard operation
Enma copied to clipboard

Add page count filter

Open alexander-cummings opened this issue 1 year ago • 1 comments

This is an enhancement request to add the capability to more easily filter by page count of a source. This is only really applicable to sources like nhentai where there is only one "chapter" as far as I can tell.

Currently, I do something along the lines of the following to filter by a minimum page count (probably don't need the sum loop as I believe nhentai only has one chapter for each result but ¯\_(ツ)_/¯):

search_results_with_minimum_pages = []

search_results = enma.search(query)

for result in search_results.results:
    doujin_information = enma.get(result.id, False)
    
    total_page_count = sum(
        chapter.pages_count for chapter in doujin_information.chapters
        if chapter is not None and chapter.pages_count is not None
    )
    
    if total_page_count >= doujin_page_minimum:
        search_results_with_minimum_pages.append(doujin_information)

alexander-cummings avatar May 07 '24 12:05 alexander-cummings

Thanks for the suggestion!

AlexandreSenpai avatar May 07 '24 14:05 AlexandreSenpai