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

Commit 3ccff0b2 authored by jurgbohn's avatar jurgbohn

Added user.gettoptracks to /2.0/index.php

No limit on number of tracks fetched; period of "overall" will
fetch -all- tracks the user has ever played. Use with caution ;)
parent 9d86bdac
......@@ -41,9 +41,19 @@ $method_map = array(
"auth.gettoken" => method_auth_gettoken,
"auth.getsession" => method_auth_getsession,
"artist.gettoptracks" => method_artist_gettoptracks,
"user.getinfo" => method_user_getinfo
"user.getinfo" => method_user_getinfo,
"user.gettoptracks" => method_user_gettoptracks
);
function method_user_gettoptracks() {
if (!isset($_GET['user'])) {
report_failure(LFM_INVALID_SIGNATURE);
}
header("Content-Type: text/xml");
print(XML::prettyXML(User::getTopTracks($_GET['user'], $_GET['period'])));
}
function method_user_getinfo() {
if (!isset($_GET['user'])) {
report_failure(LFM_INVALID_SIGNATURE);
......
......@@ -32,6 +32,8 @@ class User {
global $mdb2;
$timestamp;
if (!isset($time))
$time = "overall";
if (strcmp($time, "overall") == 0) {
$timestamp = 0;
......
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