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

@ -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;