mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Add the popularity field to the RPC interface
Implements FS#45422. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
d1c331613d
commit
5a050552e8
1 changed files with 13 additions and 1 deletions
|
@ -33,6 +33,14 @@ class AurJSON {
|
||||||
'Users.UserName AS Maintainer',
|
'Users.UserName AS Maintainer',
|
||||||
'SubmittedTS AS FirstSubmitted', 'ModifiedTS AS LastModified'
|
'SubmittedTS AS FirstSubmitted', 'ModifiedTS AS LastModified'
|
||||||
);
|
);
|
||||||
|
private static $fields_v4 = array(
|
||||||
|
'Packages.ID', 'Packages.Name',
|
||||||
|
'PackageBases.ID AS PackageBaseID',
|
||||||
|
'PackageBases.Name AS PackageBase', 'Version',
|
||||||
|
'Description', 'URL', 'NumVotes', 'Popularity',
|
||||||
|
'OutOfDateTS AS OutOfDate', 'Users.UserName AS Maintainer',
|
||||||
|
'SubmittedTS AS FirstSubmitted', 'ModifiedTS AS LastModified'
|
||||||
|
);
|
||||||
private static $numeric_fields = array(
|
private static $numeric_fields = array(
|
||||||
'ID', 'PackageBaseID', 'NumVotes', 'OutOfDate',
|
'ID', 'PackageBaseID', 'NumVotes', 'OutOfDate',
|
||||||
'FirstSubmitted', 'LastModified'
|
'FirstSubmitted', 'LastModified'
|
||||||
|
@ -211,7 +219,11 @@ class AurJSON {
|
||||||
"GROUP BY Packages.ID " .
|
"GROUP BY Packages.ID " .
|
||||||
"LIMIT $max_results";
|
"LIMIT $max_results";
|
||||||
} elseif ($this->version >= 2) {
|
} elseif ($this->version >= 2) {
|
||||||
|
if ($this->version == 2 || $this->version == 3) {
|
||||||
$fields = implode(',', self::$fields_v2);
|
$fields = implode(',', self::$fields_v2);
|
||||||
|
} else if ($this->version == 4) {
|
||||||
|
$fields = implode(',', self::$fields_v4);
|
||||||
|
}
|
||||||
$query = "SELECT {$fields} " .
|
$query = "SELECT {$fields} " .
|
||||||
"FROM Packages LEFT JOIN PackageBases " .
|
"FROM Packages LEFT JOIN PackageBases " .
|
||||||
"ON PackageBases.ID = Packages.PackageBaseID " .
|
"ON PackageBases.ID = Packages.PackageBaseID " .
|
||||||
|
|
Loading…
Add table
Reference in a new issue