Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions backend/fastrtc/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,12 @@ def __init__(
self.server_rtc_configuration = self.convert_to_aiortc_format(
server_rtc_configuration
)
self.verbose = verbose

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert changes: self.verbose, self._ui shouldn't change

self._ui = self._generate_default_ui(ui_args)
self._ui.launch = self._wrap_gradio_launch(self._ui.launch)
def get_all_connections(self) -> List[str]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repo is using typing hints for Python 3.10+. It is enough (and preferred) to use [str]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing docstring. See e.g., #405

all_ids = list(self.connections.keys()) # type: ignore

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why type ignore?

if self.webrtc_component and hasattr(self.webrtc_component, "connections"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is enough to check that if self.webrtc_component since it is guaranteed to have the attribute connections.

all_ids += list(self.webrtc_component.connections.keys()) # type: ignore

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why type ignore?

return all_ids


def mount(
self, app: FastAPI, path: str = "", tags: list[str | Enum] | None = None
Expand Down