We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 94e5c34d authored by Mike Sheldon's avatar Mike Sheldon

Remove some duplicated code from webservice index

parent 24ef64f4
......@@ -110,13 +110,10 @@ function method_user_getRecentTracks() {
report_failure(LFM_INVALID_PARAMS);
}
if (isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = 1;
}
$limit = get_with_default('limit', 50);
$page = get_with_default('page', 1);
$xml = UserXML::getRecentTracks($_GET['user'], $_GET['limit'], $page);
$xml = UserXML::getRecentTracks($_GET['user'], $limit, $page);
respond($xml);
}
......@@ -168,11 +165,7 @@ function method_user_getBannedTracks() {
}
$user = $_GET['user'];
if (isset($_GET['limit'])) {
$limit = $_GET['limit'];
} else {
$limit = 50;
}
get_with_default('limit', 50);
$xml = UserXML::getBannedTracks($user, $limit);
respond($xml);
......@@ -184,11 +177,7 @@ function method_user_getNeighbours() {
}
$user = $_GET['user'];
if (isset($_GET['limit'])) {
$limit = $_GET['limit'];
} else {
$limit = 50;
}
$limit = get_with_default('limit', 50);
$xml = UserXML::getNeighbours($user, $limit);
respond($xml);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment