audio streaming app
plyr.fm
1---
2title: activity
3sidebarTitle: activity
4---
5
6# `backend.api.activity`
7
8
9activity feed — platform-wide chronological event stream.
10
11## Functions
12
13### `get_activity_feed` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/activity.py#L256)
14
15```python
16get_activity_feed(db: Annotated[AsyncSession, Depends(get_db)], cursor: str | None = Query(None), limit: int = Query(20)) -> ActivityFeedResponse
17```
18
19
20get the platform-wide activity feed.
21
22
23### `get_activity_histogram` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/activity.py#L352)
24
25```python
26get_activity_histogram(db: Annotated[AsyncSession, Depends(get_db)], days: int = Query(7, ge=1, le=30)) -> ActivityHistogramResponse
27```
28
29
30get activity counts per day for the sparkline.
31
32
33## Classes
34
35### `ActivityActor` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/activity.py#L20)
36
37
38actor who performed the activity.
39
40
41**Methods:**
42
43#### `normalize_avatar` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/activity.py#L30)
44
45```python
46normalize_avatar(cls, v: str | None) -> str | None
47```
48
49### `ActivityTrack` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/activity.py#L34)
50
51
52track referenced in an activity event.
53
54
55**Methods:**
56
57#### `normalize_avatar` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/activity.py#L46)
58
59```python
60normalize_avatar(cls, v: str | None) -> str | None
61```
62
63### `ActivityCollection` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/activity.py#L50)
64
65
66collection referenced in an activity event.
67
68
69### `ActivityEvent` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/activity.py#L61)
70
71
72single activity event.
73
74
75### `ActivityFeedResponse` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/activity.py#L80)
76
77
78paginated activity feed.
79
80
81### `ActivityHistogramBucket` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/activity.py#L88)
82
83
84single day in the activity histogram.
85
86
87### `ActivityHistogramResponse` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/activity.py#L95)
88
89
90activity counts per day over a time window.
91