1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00

Count articles without offset or limit

This commit is contained in:
J. King 2021-02-02 16:14:04 -05:00
parent 0e7abfa8f9
commit 23ca6bb77b

View file

@ -1024,7 +1024,7 @@ class V1 extends \JKingWeb\Arsse\REST\AbstractHandler {
}
// finally compute the total number of entries match the query, if the query hs a limit or offset
if ($c->limit || $c->offset) {
$count = Arsse::$db->articleCount(Arsse::$user->id, $c);
$count = Arsse::$db->articleCount(Arsse::$user->id, (clone $c)->limit(0)->offset(0));
} else {
$count = sizeof($out);
}
@ -1032,7 +1032,7 @@ class V1 extends \JKingWeb\Arsse\REST\AbstractHandler {
}
public static function tokenGenerate(string $user, string $label): string {
// Miniflux produces tokens in base64url alphabet
// Miniflux produces tokenss in base64url alphabet
$t = str_replace(["+", "/"], ["-", "_"], base64_encode(random_bytes(self::TOKEN_LENGTH)));
return Arsse::$db->tokenCreate($user, "miniflux.login", $t, null, $label);
}