Skip to content

Add page count filter #76

Description

@alexander-cummings

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions