From 86aa6fdd23bfbea378407ca716d257a6bc89dbb1 Mon Sep 17 00:00:00 2001 From: Daniel Dugovic Date: Sat, 28 Oct 2023 01:53:23 -0500 Subject: [PATCH 1/2] Discover live streams in category shogi-2010 (fix #737) --- conf/base.conf | 3 ++- modules/streamer/src/main/TwitchApi.scala | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/conf/base.conf b/conf/base.conf index b7a8f48daa2d..2da08a4a1c75 100644 --- a/conf/base.conf +++ b/conf/base.conf @@ -316,7 +316,8 @@ streamer { twitch { client_id = "" secret = "" - game_id = "1593570952" + game_id = "368914" + game_id2 = "1593570952" } google.api_key = "" keyword = "lishogi.org" diff --git a/modules/streamer/src/main/TwitchApi.scala b/modules/streamer/src/main/TwitchApi.scala index 0f9d7518ef94..dad9a27e428a 100644 --- a/modules/streamer/src/main/TwitchApi.scala +++ b/modules/streamer/src/main/TwitchApi.scala @@ -20,8 +20,9 @@ final private class TwitchApi(ws: WSClient, config: TwitchConfig)(implicit ec: E ): Fu[List[Twitch.TwitchStream]] = (config.clientId.nonEmpty && config.secret.value.nonEmpty && config.gameId.nonEmpty && page < 10) ?? { val query = List( - "game_id" -> config.gameId, // shogi - "first" -> "100" // max results per page + "game_id" -> config.gameId, // shogi-2010 + "game_id" -> config.gameId2, // shogi + "first" -> "100" // max results per page ) ::: List( pagination.flatMap(_.cursor).map { "after" -> _ } ).flatten From 209e7fcffd921c4ccc8cb9301b717940c8573819 Mon Sep 17 00:00:00 2001 From: Daniel Dugovic Date: Sat, 28 Oct 2023 02:47:46 -0500 Subject: [PATCH 2/2] Add second Twitch game ID property --- modules/streamer/src/main/Env.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/streamer/src/main/Env.scala b/modules/streamer/src/main/Env.scala index c4463a8b94bc..41c684f427a5 100644 --- a/modules/streamer/src/main/Env.scala +++ b/modules/streamer/src/main/Env.scala @@ -18,7 +18,8 @@ private class StreamerConfig( private class TwitchConfig( @ConfigName("client_id") val clientId: String, val secret: Secret, - @ConfigName("game_id") val gameId: String + @ConfigName("game_id") val gameId: String, + @ConfigName("game_id2") val gameId2: String ) @Module