From a240eb9f20e6839f8e1a42123708364080f66ee6 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 11 Jan 2020 15:51:31 +0100 Subject: [PATCH] Fix bug? --- pyproject.toml | 2 +- royalpack/stars/api_discord_play.py | 7 ++++++- royalpack/version.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5b658c8c..98256425 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ [tool.poetry] name = "royalpack" - version = "5.2.6" + version = "5.2.8" description = "A Royalnet command pack for the Royal Games community" authors = ["Stefano Pigozzi "] license = "AGPL-3.0+" diff --git a/royalpack/stars/api_discord_play.py b/royalpack/stars/api_discord_play.py index 680ed5e3..194a89e3 100644 --- a/royalpack/stars/api_discord_play.py +++ b/royalpack/stars/api_discord_play.py @@ -3,6 +3,10 @@ from starlette.requests import Request from starlette.responses import * from royalnet.constellation import * from royalnet.utils import * +import logging + + +log = logging.getLogger(__name__) class ApiDiscordPlayStar(PageStar): @@ -11,9 +15,10 @@ class ApiDiscordPlayStar(PageStar): async def page(self, request: Request) -> JSONResponse: url = request.query_params.get("url", "") try: - guild_id: Optional[int] = int(request.path_params.get("guild_id", None)) + guild_id: Optional[int] = int(request.query_params.get("guild_id", None)) except (ValueError, TypeError): guild_id = None + log.info(f"Received request to play {url} on guild_id {guild_id} via web") response = await self.interface.call_herald_event("discord", "discord_play", url=url, guild_id=guild_id) return JSONResponse(response, headers={ "Access-Control-Allow-Origin": self.interface.config['Funkwhale']['instance_url'], diff --git a/royalpack/version.py b/royalpack/version.py index 2d87e352..29bba64a 100644 --- a/royalpack/version.py +++ b/royalpack/version.py @@ -1 +1 @@ -semantic = "5.2.6" +semantic = "5.2.8"