Skip to content

Conversation

@kbuffington
Copy link

Adding new AJAX end point: user_torrents. This allows the retrieval of the torrents and primary artists for the torrents a user is seeding from one of the four types: seeding, leeching, uploaded, snatched. Results are ordered starting with most-recent first. This replicates the data available from torrents.php with a type and userid specified.

The end point properly handles paranoia settings for non-logged in users.

Required variables:
userid: the user to retrieve torrent information for
type: seeding, leeching, uploaded, snatched

Optional
limit, offset

An example request and response:

// https://what.cd/ajax.php?action=user_torrents&userid=2&type=seeding&limit=3&offset=1

{
  "status": "success",
  "response": {
    "seeding": [
      {
        "groupId": "4",
        "name": "If You Have Ghost",
        "torrentId": "4",
        "artistName": "Ghost B.C.",
        "artistId": "4"
      },
      {
        "groupId": "3",
        "name": "Absolute Dissent",
        "torrentId": "3",
        "artistName": "Killing Joke",
        "artistId": "3"
      }
    ]
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant