Skip to content

Commit 1d3b647

Browse files
committed
ruff
1 parent ce435eb commit 1d3b647

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

livekit-rtc/livekit/rtc/audio_filter.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66

77
class AudioFilter:
88
def __init__(
9-
self,
10-
path: str,
11-
url: str,
12-
token: str,
13-
dependencies: list[str] = None
9+
self, path: str, url: str, token: str, dependencies: list[str] = None
1410
) -> None:
1511
self._path = path
1612

1713
req = proto_ffi.FfiRequest()
1814
req.load_audio_filter_plugin.plugin_path = path
19-
req.load_audio_filter_plugin.dependencies[:] = dependencies if dependencies is not None else []
20-
req.load_audio_filter_plugin.options = json.dumps({
21-
"url": url,
22-
"token": token,
23-
})
15+
req.load_audio_filter_plugin.dependencies[:] = (
16+
dependencies if dependencies is not None else []
17+
)
18+
req.load_audio_filter_plugin.options = json.dumps(
19+
{
20+
"url": url,
21+
"token": token,
22+
}
23+
)
2424

2525
resp = FfiClient.instance.request(req)
2626

livekit-rtc/livekit/rtc/room.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ def __init__(self, message: str):
127127

128128

129129
class Room(EventEmitter[EventTypes]):
130-
def __init__(self, loop: Optional[asyncio.AbstractEventLoop] = None, filters: Optional[List[Any]] = None) -> None:
130+
def __init__(
131+
self,
132+
loop: Optional[asyncio.AbstractEventLoop] = None,
133+
filters: Optional[List[Any]] = None,
134+
) -> None:
131135
"""Initializes a new Room instance.
132136
133137
Parameters:
@@ -375,15 +379,15 @@ def on_participant_connected(participant):
375379
)
376380

377381
for f in self._filters:
378-
if hasattr(f, 'dependencies_path'):
382+
if hasattr(f, "dependencies_path"):
379383
deps = f.dependencies_path() or []
380384
else:
381385
deps = []
382386
self._filter_instances[f] = AudioFilter(
383-
path = f.plugin_path(),
384-
url = url,
385-
token = token,
386-
dependencies = deps,
387+
path=f.plugin_path(),
388+
url=url,
389+
token=token,
390+
dependencies=deps,
387391
)
388392

389393
# subscribe before connecting so we don't miss any events
@@ -421,7 +425,6 @@ def on_participant_connected(participant):
421425
publication = RemoteTrackPublication(owned_publication_info)
422426
rp._track_publications[publication.sid] = publication
423427

424-
425428
# start listening to room events
426429
self._task = self._loop.create_task(self._listen_task())
427430

@@ -573,7 +576,7 @@ def _on_room_event(self, event: proto_room.RoomEvent):
573576
)
574577
elif track_info.kind == TrackKind.KIND_AUDIO:
575578
remote_audio_track = RemoteAudioTrack(owned_track_info)
576-
remote_audio_track._set_room(self) # set room ref for audio filter
579+
remote_audio_track._set_room(self) # set room ref for audio filter
577580
rpublication.track = remote_audio_track
578581
self.emit(
579582
"track_subscribed", remote_audio_track, rpublication, rparticipant

0 commit comments

Comments
 (0)