Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setting media endpoint #298

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all 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
6 changes: 3 additions & 3 deletions heisenbridge/control_room.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,19 +570,19 @@ async def cmd_media_url(self, args):
if args.remove:
self.serv.config["media_url"] = None
await self.serv.save()
self.serv.endpoint = await self.serv.detect_public_endpoint()
self.serv.media_endpoint = await self.serv.detect_public_endpoint()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should probably reset it to the one set in the registration (or None if that's not set either)

elif args.url:
parsed = urlparse(args.url)
if parsed.scheme in ["http", "https"] and not parsed.params and not parsed.query and not parsed.fragment:
self.serv.config["media_url"] = args.url
await self.serv.save()
self.serv.endpoint = args.url
self.serv.media_endpoint = args.url
else:
self.send_notice(f"Invalid media URL format: {args.url}")
return

self.send_notice(f"Media URL override is set to {self.serv.config['media_url']}")
self.send_notice(f"Current active media URL: {self.serv.endpoint}")
self.send_notice(f"Current active media URL: {self.serv.media_endpoint}")

async def cmd_media_path(self, args):
if args.remove:
Expand Down
Loading