Don't use sorting heuristic in comics with more than 1000 pages

Sorting heuristic to try to find spreads in the content of a comic is now only used for files with less than 1000 pages to avoid false positives.
This commit is contained in:
Luis Ángel San Martín 2024-08-09 16:00:30 +02:00
parent be90e9e3a1
commit e4469dc7a7
2 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,9 @@ Version counting is based on semantic versioning (Major.Feature.Patch)
* Fix headers in the table view getting stuck in a non moveable state.
* Add option to set the type of a library. It will convert all the content to desired type (comic, manga, etc) and it will set that type as the default one for that library. Available in the library context menu.
### All apps
* Sorting heuristic to try to find spreads in the content of a comic is now only used for files with less than 1000 pages to avoid false positives.
## 9.14.2
### YACReaderLibrary

View File

@ -1067,6 +1067,13 @@ void comic_pages_sort(QList<QString> &pageNames, YACReaderPageSortingMode sortin
case YACReaderHeuristicSorting: {
std::sort(pageNames.begin(), pageNames.end(), naturalSortLessThanCI);
// This heuristic tries to find spreads named like 1011.jpg, which means page 10 and 11 toghether in a single image file
// if the issue has more than 1000 pages lets not use this heuristic to avoid false positives.
// Alternativelly the heuristic could be improved but I don't think it's worth the effort.
if (pageNames.size() >= 1000) {
return;
}
QList<QString> singlePageNames;
QList<QString> doublePageNames;