diff options
-rwxr-xr-x | aports.lua | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -104,7 +104,8 @@ function QueryContents(filename, pkgname, arch, page) local offset = (tonumber(page) == nil) and 0 or tonumber(page)*50 local dbh = assert(DBI.Connect('SQLite3', 'db/filelist.db')) local sth = assert(dbh:prepare('select * from filelist where file like ? and pkgname like ? and arch like ? limit ?,50')) - sth:execute(filename, pkgname, arch, offset) + sth:execute(filename, pkgname, arch, (page - 1) * 50) + print((page - 1) * 50) local r = {} for row in sth:rows(true) do r[#r + 1] = { @@ -126,7 +127,7 @@ function QueryPackages(package, arch, page) local sth = assert(dbh:prepare('select name, version, url, lic, desc, arch, repo, maintainer, datetime(build_time, \'unixepoch\') as build_time from apkindex where name like ? and arch like ? ORDER BY build_time DESC limit ?,50')) local offset = (tonumber(page) == nil) and 0 or tonumber(page)*50 local offset = (page - 1) * 50 - sth:execute(package, arch, offset) + sth:execute(package, arch, (page - 1) * 50) local r = {} for row in sth:rows(true) do r[#r+1] = { |