Skip to content

Commit

Permalink
Merge pull request WandererXII#743 from ddugovic/twitch-game-id2
Browse files Browse the repository at this point in the history
Discover live streams in category shogi-2010 (fix WandererXII#737)
  • Loading branch information
WandererXII authored Nov 30, 2023
2 parents b4208e8 + 209e7fc commit 8ad7f26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion conf/base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ streamer {
twitch {
client_id = ""
secret = ""
game_id = "1593570952"
game_id = "368914"
game_id2 = "1593570952"
}
google.api_key = ""
keyword = "lishogi.org"
Expand Down
3 changes: 2 additions & 1 deletion modules/streamer/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions modules/streamer/src/main/TwitchApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ad7f26

Please sign in to comment.