Skip to content

Commit 93272e4

Browse files
committed
wip
1 parent f4fdbc4 commit 93272e4

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

hasura/functions/match/get_match_tv_connection_string.sql

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CREATE OR REPLACE FUNCTION public.get_match_tv_connection_string(match public.ma
99
tv_port int;
1010
started_at timestamp;
1111
tv_delay int;
12+
use_playcast text;
1213
BEGIN
1314
SELECT s.host, s.tv_port, m.started_at, mo.tv_delay
1415
INTO server_host, tv_port, started_at, tv_delay
@@ -28,6 +29,12 @@ CREATE OR REPLACE FUNCTION public.get_match_tv_connection_string(match public.ma
2829
return null;
2930
end if;
3031

31-
RETURN CONCAT('connect ', CONCAT(server_host, ':', tv_port), '; password ', password);
32+
use_playcast := get_setting('use_playcast', 'false');
33+
34+
if(use_playcast = 'true') then
35+
return CONCAT('playcast ', '"https://relay.5stack.gg/', match_id, '"');
36+
else
37+
return CONCAT('connect ', CONCAT(server_host, ':', tv_port), '; password ', password);
38+
end if;
3239
END;
3340
$$;

0 commit comments

Comments
 (0)