Allow negative values for maxPages

maxPages: -1 means to skip the last page
This commit is contained in:
Sebastián Katzer 2019-01-24 12:12:50 +01:00
parent 783cc42613
commit 98b5d32527

View File

@ -71,7 +71,12 @@
NSInteger num = [super numberOfPages]; NSInteger num = [super numberOfPages];
id maxPages = _settings[@"maxPages"]; id maxPages = _settings[@"maxPages"];
return maxPages ? MIN(num, [maxPages longValue]) : num; if (maxPages < 0)
{
return MAX(1, num + [maxPages longValue]);
}
return maxPages ? MAX(1, MIN(num, [maxPages longValue])) : num;
} }
#pragma mark - #pragma mark -