Skip to content

Commit

Permalink
Use urlparse to detect if app_link_or_app_id is a link
Browse files Browse the repository at this point in the history
  • Loading branch information
tronikos committed May 6, 2024
1 parent 98c01ee commit c5d7292
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "androidtvremote2"
version = "0.1.0"
version = "0.1.1"
license = {text = "Apache-2.0"}
authors = [
{ name="tronikos", email="tronikos@gmail.com" },
Expand Down
3 changes: 2 additions & 1 deletion src/androidtvremote2/androidtv_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from collections.abc import Callable
import os
import ssl
from urllib.parse import urlparse

import aiofiles
from cryptography import x509
Expand Down Expand Up @@ -397,7 +398,7 @@ def send_launch_app_command(self, app_link_or_app_id: str) -> None:
if not self._remote_message_protocol:
LOGGER.debug("Called send_launch_app_command after disconnect")
raise ConnectionClosed("Called send_launch_app_command after disconnect")
prefix = "" if "://" in app_link_or_app_id else "market://launch?id="
prefix = "" if urlparse(app_link_or_app_id).scheme else "market://launch?id="
self._remote_message_protocol.send_launch_app_command(
f"{prefix}{app_link_or_app_id}"
)

0 comments on commit c5d7292

Please sign in to comment.