aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2019-09-29 00:18:06 +0000
committerAriadne Conill <ariadne@dereferenced.org>2019-09-30 10:39:48 +0000
commita6e1469767cd716eccf1106e3704130a4fc909b8 (patch)
tree08b324e83d2719502c939fc109ec230e2dd5d3b0
parent8b34b221cbec366e0a605b9e64dafceb76ed3fd3 (diff)
downloadpleroma-a6e1469767cd716eccf1106e3704130a4fc909b8.tar.gz
router: change scrobble timeline route from now-playing to scrobbles
-rw-r--r--docs/api/pleroma_api.md6
-rw-r--r--lib/pleroma/web/pleroma_api/controllers/pleroma_api_controller.ex2
-rw-r--r--lib/pleroma/web/router.ex2
3 files changed, 6 insertions, 4 deletions
diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md
index 183cf8a28..33116b4b9 100644
--- a/docs/api/pleroma_api.md
+++ b/docs/api/pleroma_api.md
@@ -440,7 +440,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
* Response: the archive of the pack with a 200 status code, 403 if the pack is not set as shared,
404 if the pack does not exist
-## `GET /api/v1/pleroma/accounts/:uid/now-playing`
+## `GET /api/v1/pleroma/accounts/:id/scrobbles`
### Requests a list of current and recent Listen activities for an account
* Method `GET`
* Authentication: not required
@@ -450,11 +450,13 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
```json
[
{
+ "account": {...},
"id": "1234",
"title": "Some Title",
"artist": "Some Artist",
"album": "Some Album",
- "length": 180000
+ "length": 180000,
+ "created_at": "2019-09-28T12:40:45.000Z"
}
]
```
diff --git a/lib/pleroma/web/pleroma_api/controllers/pleroma_api_controller.ex b/lib/pleroma/web/pleroma_api/controllers/pleroma_api_controller.ex
index 1b0ed1f40..6010732db 100644
--- a/lib/pleroma/web/pleroma_api/controllers/pleroma_api_controller.ex
+++ b/lib/pleroma/web/pleroma_api/controllers/pleroma_api_controller.ex
@@ -110,7 +110,7 @@ defmodule Pleroma.Web.PleromaAPI.PleromaAPIController do
end
end
- def user_now_playing(%{assigns: %{user: reading_user}} = conn, params) do
+ def user_scrobbles(%{assigns: %{user: reading_user}} = conn, params) do
with %User{} = user <- User.get_cached_by_nickname_or_id(params["id"], for: reading_user) do
params = Map.put(params, "type", ["Listen"])
diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex
index bd5f02af1..8966e8cc0 100644
--- a/lib/pleroma/web/router.ex
+++ b/lib/pleroma/web/router.ex
@@ -310,7 +310,7 @@ defmodule Pleroma.Web.Router do
scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
pipe_through([:api, :oauth_read_or_public])
- get("/accounts/:id/now-playing", PleromaAPIController, :user_now_playing)
+ get("/accounts/:id/scrobbles", PleromaAPIController, :user_scrobbles)
end
scope "/api/v1", Pleroma.Web.MastodonAPI do