Skip to content

Commit 78b6ffc

Browse files
authored
Rename room types broadcaster -> livestream, full_feature -> conference (#28)
* Rename room types broadcaster -> livestream, full_feature -> conference * Fix lint warnings * Fix lint warnings
1 parent 894d775 commit 78b6ffc

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

examples/room_manager/room_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def __find_or_create_room(
8181
options = RoomOptions(
8282
max_peers=self.config.max_peers,
8383
webhook_url=self.config.webhook_url,
84-
room_type=room_type.value if room_type else "full_feature",
84+
room_type=room_type.value if room_type else "conference",
8585
)
8686

8787
new_room = self.fishjam_client.create_room(options=options)

fishjam/_openapi_client/api/viewer/generate_token.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def sync_detailed(
6666
*,
6767
client: Union[AuthenticatedClient, Client],
6868
) -> Response[Union[Error, ViewerToken]]:
69-
"""Generate single broadcaster access token
69+
"""Generate single livestream access token
7070
7171
Args:
7272
room_id (str):
@@ -95,7 +95,7 @@ def sync(
9595
*,
9696
client: Union[AuthenticatedClient, Client],
9797
) -> Optional[Union[Error, ViewerToken]]:
98-
"""Generate single broadcaster access token
98+
"""Generate single livestream access token
9999
100100
Args:
101101
room_id (str):
@@ -119,7 +119,7 @@ async def asyncio_detailed(
119119
*,
120120
client: Union[AuthenticatedClient, Client],
121121
) -> Response[Union[Error, ViewerToken]]:
122-
"""Generate single broadcaster access token
122+
"""Generate single livestream access token
123123
124124
Args:
125125
room_id (str):
@@ -146,7 +146,7 @@ async def asyncio(
146146
*,
147147
client: Union[AuthenticatedClient, Client],
148148
) -> Optional[Union[Error, ViewerToken]]:
149-
"""Generate single broadcaster access token
149+
"""Generate single livestream access token
150150
151151
Args:
152152
room_id (str):

fishjam/_openapi_client/models/room_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class RoomConfig:
1616

1717
max_peers: Union[Unset, None, int] = UNSET
1818
"""Maximum amount of peers allowed into the room"""
19-
room_type: Union[Unset, RoomConfigRoomType] = RoomConfigRoomType.FULL_FEATURE
20-
"""The use-case of the room. If not provided, this defaults to full_feature."""
19+
room_type: Union[Unset, RoomConfigRoomType] = RoomConfigRoomType.CONFERENCE
20+
"""The use-case of the room. If not provided, this defaults to conference."""
2121
video_codec: Union[Unset, None, RoomConfigVideoCodec] = UNSET
2222
"""Enforces video codec for each peer in the room"""
2323
webhook_url: Union[Unset, None, str] = UNSET

fishjam/_openapi_client/models/room_config_room_type.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33

44
class RoomConfigRoomType(str, Enum):
5-
"""The use-case of the room. If not provided, this defaults to full_feature."""
5+
"""The use-case of the room. If not provided, this defaults to conference."""
66

77
AUDIO_ONLY = "audio_only"
88
BROADCASTER = "broadcaster"
9+
CONFERENCE = "conference"
910
FULL_FEATURE = "full_feature"
11+
LIVESTREAM = "livestream"
1012

1113
def __str__(self) -> str:
1214
return str(self.value)

fishjam/_openapi_client/models/viewer_token.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
@_attrs_define
1010
class ViewerToken:
11-
"""Token for authorizing broadcaster viewer connection"""
11+
"""Token for authorizing livestream viewer connection"""
1212

1313
token: str
1414
"""None"""

fishjam/api/_fishjam_client.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ class RoomOptions:
5656
webhook_url: str | None = None
5757
"""URL where Fishjam notifications will be sent"""
5858
room_type: Literal[
59-
"full_feature", "audio_only", "broadcaster", "livestream"
60-
] = "full_feature"
61-
"""The use-case of the room. If not provided, this defaults to full_feature."""
59+
"conference", "audio_only", "livestream", "full_feature", "broadcaster"
60+
] = "conference"
61+
"""The use-case of the room. If not provided, this defaults to conference."""
6262

6363

6464
@dataclass
@@ -118,9 +118,6 @@ def create_room(self, options: RoomOptions | None = None) -> Room:
118118
if options.video_codec:
119119
codec = RoomConfigVideoCodec(options.video_codec)
120120

121-
if options.room_type == "livestream":
122-
options.room_type = "broadcaster"
123-
124121
config = RoomConfig(
125122
max_peers=options.max_peers,
126123
video_codec=codec,

tests/test_room_api.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
MAX_PEERS = 10
3232
CODEC_H264 = "h264"
3333
AUDIO_ONLY = "audio_only"
34-
FULL_FEATURE = "full_feature"
34+
CONFERENCE = "conference"
35+
LIVESTREAM = "livestream"
3536

3637

3738
class TestAuthentication:
@@ -65,7 +66,7 @@ def test_no_params(self, room_api):
6566
max_peers=None,
6667
video_codec=None,
6768
webhook_url=None,
68-
room_type=RoomConfigRoomType(FULL_FEATURE),
69+
room_type=RoomConfigRoomType(CONFERENCE),
6970
)
7071
config.__setitem__("roomId", room.config.__getitem__("roomId"))
7172
config.__setitem__(
@@ -152,7 +153,7 @@ def test_valid(self, room_api: FishjamClient):
152153
max_peers=None,
153154
video_codec=None,
154155
webhook_url=None,
155-
room_type=RoomConfigRoomType(FULL_FEATURE),
156+
room_type=RoomConfigRoomType(CONFERENCE),
156157
)
157158
config.__setitem__("roomId", room.config.__getitem__("roomId"))
158159
config.__setitem__(
@@ -255,7 +256,7 @@ def test_invalid(self, room_api: FishjamClient):
255256

256257
class TestCreateLivestreamViewerToken:
257258
def test_valid(self, room_api: FishjamClient):
258-
room = room_api.create_room(RoomOptions(room_type="livestream"))
259+
room = room_api.create_room(RoomOptions(room_type=LIVESTREAM))
259260
viewer_token = room_api.create_livestream_viewer_token(room.id)
260261

261262
assert isinstance(viewer_token, str)

0 commit comments

Comments
 (0)