From cff3bbfd36cbc925f7c1509e33645984862908a3 Mon Sep 17 00:00:00 2001 From: JR Date: Tue, 18 Jul 2023 22:52:26 +0200 Subject: [PATCH] Add youtubeKeygen alias to googleKeygen ...in --set twitch.* contexts. --- source/kameloso/platform.d | 1 + source/kameloso/plugins/twitch/base.d | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/source/kameloso/platform.d b/source/kameloso/platform.d index f8882625e2..71c934b369 100644 --- a/source/kameloso/platform.d +++ b/source/kameloso/platform.d @@ -355,6 +355,7 @@ Pid execvp(/*const*/ string[] args) @system "twitch.keygen", "twitch.superKeygen", "twitch.googleKeygen", + "twitch.youtubeKeygen", "twitch.spotifyKeygen")) { toRemove ~= i; diff --git a/source/kameloso/plugins/twitch/base.d b/source/kameloso/plugins/twitch/base.d index 25846098db..44fd596fed 100644 --- a/source/kameloso/plugins/twitch/base.d +++ b/source/kameloso/plugins/twitch/base.d @@ -136,6 +136,11 @@ public: +/ bool googleKeygen = false; + /++ + Runtime "alias" to [googleKeygen]. + +/ + bool youtubeKeygen = false; + /++ Whether or not to start a captive session for requesting Spotify access tokens. @@ -2671,6 +2676,7 @@ void start(TwitchPlugin plugin) plugin.twitchSettings.keygen || plugin.twitchSettings.superKeygen || plugin.twitchSettings.googleKeygen || + plugin.twitchSettings.youtubeKeygen || plugin.twitchSettings.spotifyKeygen; if (!plugin.state.server.address.endsWith(".twitch.tv")) @@ -2728,13 +2734,15 @@ void start(TwitchPlugin plugin) needSeparator = true; } - if (plugin.twitchSettings.googleKeygen) + if (plugin.twitchSettings.googleKeygen || + plugin.twitchSettings.youtubeKeygen) { import kameloso.plugins.twitch.google : requestGoogleKeys; if (needSeparator) logger.trace(separator); requestGoogleKeys(plugin); if (*plugin.state.abort) return; plugin.twitchSettings.googleKeygen = false; + plugin.twitchSettings.youtubeKeygen = false; needSeparator = true; } @@ -2749,11 +2757,12 @@ void start(TwitchPlugin plugin) // Remove custom Twitch settings so we can reconnect without jumping // back into keygens. - static immutable string[4] settingsToPop = + static immutable string[5] settingsToPop = [ "twitch.keygen", "twitch.superKeygen", "twitch.googleKeygen", + "twitch.youtubeKeygen", "twitch.spotifyKeygen", ]; @@ -4238,6 +4247,7 @@ package: twitchSettings.keygen || twitchSettings.superKeygen || twitchSettings.googleKeygen || + twitchSettings.youtubeKeygen || twitchSettings.spotifyKeygen); }