diff --git a/api-server/src/main/kotlin/club/speedrun/vods/Application.kt b/api-server/src/main/kotlin/club/speedrun/vods/Application.kt index 3110fc2c..0fc11edf 100644 --- a/api-server/src/main/kotlin/club/speedrun/vods/Application.kt +++ b/api-server/src/main/kotlin/club/speedrun/vods/Application.kt @@ -1,11 +1,6 @@ package club.speedrun.vods -import club.speedrun.vods.marathon.ESAMarathon -import club.speedrun.vods.marathon.GDQMarathon -import club.speedrun.vods.marathon.GdqDatabase -import club.speedrun.vods.marathon.HEKMarathon -import club.speedrun.vods.marathon.Marathon -import club.speedrun.vods.marathon.RPGLBMarathon +import club.speedrun.vods.marathon.* import club.speedrun.vods.plugins.configureHTTP import club.speedrun.vods.plugins.configureMonitoring import club.speedrun.vods.plugins.configureOAuth @@ -34,7 +29,8 @@ val gdq = GDQMarathon() val esa = ESAMarathon() val hek = HEKMarathon() val rpglb = RPGLBMarathon() -val marathons: List = listOf(gdq, esa, hek, rpglb) +val bsg = BSGMarathon() +val marathons: List = listOf(gdq, esa, hek, rpglb, bsg) val rootDb = RootDatabase() val srcDb = SrcDatabase() val httpClient = HttpClient(OkHttp) { diff --git a/api-server/src/main/kotlin/club/speedrun/vods/marathon/Marathon.kt b/api-server/src/main/kotlin/club/speedrun/vods/marathon/Marathon.kt index 1150ef74..6320c0e7 100644 --- a/api-server/src/main/kotlin/club/speedrun/vods/marathon/Marathon.kt +++ b/api-server/src/main/kotlin/club/speedrun/vods/marathon/Marathon.kt @@ -318,7 +318,7 @@ abstract class Marathon( } get { query -> - call.respond(getEventsData(query)) + call.respond(getEventsData(query, query.skipLoad)) } get { query -> @@ -348,7 +348,7 @@ abstract class Marathon( data class Organization(val stats: Boolean = true) @Location("/events") -data class EventList(val id: String? = null) // TODO: move to subroute +data class EventList(val id: String? = null, val skipLoad: Boolean = false) // TODO: move to subroute @Location("/runs") data class RunList(val id: String? = null, val event: String? = null, val runner: Int? = null) @@ -369,6 +369,10 @@ class RPGLBMarathon : Marathon(RPGLB(), "rpglb", "RPG Limit Break", "https://rpg override fun getDonationUrl(event: EventData): String = "https://rpglimitbreak.com/tracker/ui/donate/${event.short}" override fun getScheduleUrl(event: EventData): String = "https://rpglimitbreak.com/tracker/runs/${event.id}" } +class BSGMarathon : Marathon(BSG(), "bsg", "Benelux Speedrunner Gathering", "https://bsgmarathon.com/") { + override fun getDonationUrl(event: EventData): String = "https://tracker.bsgmarathon.com/ui/donate/${event.short}" + override fun getScheduleUrl(event: EventData): String = "https://oengus.io/marathon/${event.short.lowercase()}/schedule" // this is so icky +} suspend fun Event.horaroSchedule(): FullSchedule? { if (horaroEvent == null || horaroSchedule == null) return null diff --git a/api-server/src/main/kotlin/club/speedrun/vods/plugins/Routing.kt b/api-server/src/main/kotlin/club/speedrun/vods/plugins/Routing.kt index 402205af..0a47f2d5 100644 --- a/api-server/src/main/kotlin/club/speedrun/vods/plugins/Routing.kt +++ b/api-server/src/main/kotlin/club/speedrun/vods/plugins/Routing.kt @@ -4,7 +4,6 @@ package club.speedrun.vods.plugins import club.speedrun.vods.* import club.speedrun.vods.marathon.* -import dev.qixils.gdq.models.Run import io.ktor.http.* import io.ktor.server.application.* import io.ktor.server.locations.* @@ -83,6 +82,7 @@ fun Application.configureRouting() { route("/esa", esa.route()) route("/hek", hek.route()) route("/rpglb", rpglb.route()) + route("/bsg", bsg.route()) } route("/v2") { diff --git a/api-server/src/main/kotlin/club/speedrun/vods/rabbit/RabbitManager.kt b/api-server/src/main/kotlin/club/speedrun/vods/rabbit/RabbitManager.kt index fdde6411..8af36957 100644 --- a/api-server/src/main/kotlin/club/speedrun/vods/rabbit/RabbitManager.kt +++ b/api-server/src/main/kotlin/club/speedrun/vods/rabbit/RabbitManager.kt @@ -8,11 +8,7 @@ import com.github.twitch4j.helix.domain.StreamList import com.github.twitch4j.helix.domain.Video import com.github.twitch4j.helix.domain.VideoList import com.netflix.hystrix.HystrixCommand -import com.rabbitmq.client.CancelCallback -import com.rabbitmq.client.Channel -import com.rabbitmq.client.ConnectionFactory -import com.rabbitmq.client.DeliverCallback -import com.rabbitmq.client.Delivery +import com.rabbitmq.client.* import kotlinx.coroutines.async import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.runBlocking @@ -129,7 +125,8 @@ class DeliverHandler( val runStart = sceneChanged.time.instant logger.info("Updating start time of run ${status.currentRun} to ${sceneChanged.time.iso}") val overrides = db.getOrCreateRunOverrides(null, status.currentRun) - overrides.startTime = runStart + if (overrides.startTime == null) + overrides.startTime = runStart // Fetching stream's video (should always be the latest video) val stream = streams.await().streams.firstOrNull() ?: return@coroutineScope val videos = async { twitch.videos(userId = stream.userId, type = Video.Type.ARCHIVE, limit = 1).execute() } diff --git a/kgdq/src/main/kotlin/dev/qixils/gdq/GDQ.kt b/kgdq/src/main/kotlin/dev/qixils/gdq/GDQ.kt index 1f392b90..c2303ec1 100644 --- a/kgdq/src/main/kotlin/dev/qixils/gdq/GDQ.kt +++ b/kgdq/src/main/kotlin/dev/qixils/gdq/GDQ.kt @@ -560,4 +560,5 @@ open class ESA( } class HEK : ESA("https://hekathon.esamarathon.com/search/") -class RPGLB : GDQ("https://tracker.rpglimitbreak.com/search/", ModelType.ALL.minus(ModelType.HEADSET)) \ No newline at end of file +class RPGLB : GDQ("https://tracker.rpglimitbreak.com/search/", ModelType.ALL.minus(ModelType.HEADSET)) +class BSG : GDQ("https://tracker.bsgmarathon.com/search/") // shockingly using a fresh fork of the GDQ tracker instead of ESA's ancient fork \ No newline at end of file diff --git a/web/src/app.css b/web/src/app.css index 170912b3..de819e7e 100644 --- a/web/src/app.css +++ b/web/src/app.css @@ -333,7 +333,6 @@ sup { .bid { display: flex; align-items: center; - position: relative; } .bid-body {