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

Filter by pages count #586

Closed
duckimann opened this issue Feb 6, 2022 · 6 comments
Closed

Filter by pages count #586

duckimann opened this issue Feb 6, 2022 · 6 comments

Comments

@duckimann
Copy link

Please describe your suggestion, and the problem it'd solve.

Pls add "filter by pages count" like nHentai did

"You can search for galleries with a specific number of pages with pages:20, or with a page range: pages:>20 pages:<=30."

@ndbiaw
Copy link
Contributor

ndbiaw commented Feb 6, 2022

Unavailable. The page number can only be known when decompressing the archive, which will increase the server load considerably just because of the small feature.
Counting files in archive is also not available, as it may contain other files, or the PDF file is divided into multiple pages.

@duckimann
Copy link
Author

We can have the pages count in the metadata (info.json) file right? I think the filter by pages count should only available when the archive is parsed by internal plugins.

@ndbiaw
Copy link
Contributor

ndbiaw commented Feb 6, 2022

We can have the pages count in the metadata (info.json) file right? I think the filter by pages count should only available when the archive is parsed by internal plugins.

Not all archives have and use info files, and once you've added the metadata you can sort by page number, so what's the point of creating this issue?

@RePod
Copy link
Contributor

RePod commented Feb 6, 2022

If the equivalent of unzip -l zip.zip or 7z l seven.7z is cheaper than an extraction it should be easy to approximate how many pages there are until an extraction occurs later.

The server expects certain filetypes (which I believe get lumped together when served) so irrelevant ones do not matter. For PDFs assume at least one page.

@Difegue
Copy link
Owner

Difegue commented Feb 6, 2022

Since the switch to the new libarchive bindings, it's possible to get the file count (and size) fast enough:

sub get_filelist {

This function is already used in the revamped extract/thumbnail system, and could also be leveraged to fill the pagecount field in the database on initial file indexation.
I haven't gotten to adding this to Shinobu yet, but it's something I'd like to do since having page counts only after a first decompression isn't very good UX.

Past that, extending search to take page counts into account is a good enhancement, but it certainly needs the above work done first.

Difegue added a commit that referenced this issue Mar 20, 2022
And old ones as part of the shinobu filemap process.
@Difegue Difegue pinned this issue Mar 20, 2022
@Difegue Difegue unpinned this issue May 26, 2022
@Difegue
Copy link
Owner

Difegue commented Mar 16, 2023

This'll be in 0.8.9 -- You can search for galleries with a specific number of pages with pages:20, or with a page range: pages:>20, pages:<=30.

@Difegue Difegue closed this as completed Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants