✨(frontend) serialize recording key for frontend download links
Add recording key to serialized API response to enable frontend to generate proper download links without additional backend calls. Simplifies media access workflow across the application.
This commit is contained in:
committed by
aleb_the_flash
parent
2092d586ab
commit
b927be9f16
@@ -156,7 +156,7 @@ class RecordingSerializer(serializers.ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
model = models.Recording
|
||||
fields = ["id", "room", "created_at", "updated_at", "status", "mode"]
|
||||
fields = ["id", "room", "created_at", "updated_at", "status", "mode", "key"]
|
||||
read_only_fields = fields
|
||||
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ def test_api_recordings_list_authenticated_direct(role):
|
||||
assert expected_ids == result_ids
|
||||
assert results[0] == {
|
||||
"id": str(recording.id),
|
||||
"key": recording.key,
|
||||
"created_at": recording.created_at.isoformat().replace("+00:00", "Z"),
|
||||
"mode": recording.mode,
|
||||
"room": {
|
||||
|
||||
@@ -80,6 +80,7 @@ def test_api_recording_retrieve_administrators():
|
||||
|
||||
assert content == {
|
||||
"id": str(recording.id),
|
||||
"key": recording.key,
|
||||
"room": {
|
||||
"access_level": str(room.access_level),
|
||||
"id": str(room.id),
|
||||
@@ -111,6 +112,7 @@ def test_api_recording_retrieve_owners():
|
||||
|
||||
assert content == {
|
||||
"id": str(recording.id),
|
||||
"key": recording.key,
|
||||
"room": {
|
||||
"access_level": str(room.access_level),
|
||||
"id": str(room.id),
|
||||
|
||||
Reference in New Issue
Block a user