Skip to content
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 page count filter #76

Open
alexander-cummings opened this issue May 7, 2024 · 1 comment
Open

Add page count filter #76

alexander-cummings opened this issue May 7, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@alexander-cummings
Copy link
Contributor

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)
@AlexandreSenpai AlexandreSenpai self-assigned this May 7, 2024
@AlexandreSenpai AlexandreSenpai added the enhancement New feature or request label May 7, 2024
@AlexandreSenpai
Copy link
Owner

Thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants