Skip to content

Commit

Permalink
Fix setting media endpoint
Browse files Browse the repository at this point in the history
The attribute was renamed from `endpoint` to `media_endpoint` in #290,
but the control room `mediaurl` handler missed the memo.
  • Loading branch information
ilmari committed Oct 20, 2024
1 parent 7e18a58 commit 570081c
Showing 1 changed file with 3 additions and 3 deletions.
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()
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

0 comments on commit 570081c

Please sign in to comment.