Skip to content

Commit edb69d0

Browse files
committed
Add GameTimeToBeats
1 parent 35d788c commit edb69d0

File tree

6 files changed

+27
-12
lines changed

6 files changed

+27
-12
lines changed

build.gradle.kts

+3-10
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,8 @@ sourceSets {
5353
}
5454

5555
tasks {
56-
compileKotlin {
57-
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
58-
}
59-
compileTestKotlin {
60-
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
61-
}
62-
6356
dokkaJavadoc {
64-
outputDirectory.set(buildDir.resolve("javadoc"))
57+
outputDirectory.set(layout.buildDirectory.dir("javadoc"))
6558
dependsOn(getTasksByName("generateProto", true))
6659
}
6760
withType<GenerateProtoTask> {
@@ -85,14 +78,14 @@ protobuf {
8578
this.overwrite(true)
8679
}
8780

88-
val dokkaJar by tasks.creating(Jar::class) {
81+
val dokkaJar by tasks.registering(Jar::class) {
8982
group = JavaBasePlugin.DOCUMENTATION_GROUP
9083
description = "Assembles Kotlin docs with Dokka"
9184
archiveClassifier.set("javadoc")
9285
from(tasks.dokkaJavadoc)
9386
}
9487

95-
val sourcesJar by tasks.creating(Jar::class) {
88+
val sourcesJar by tasks.registering(Jar::class) {
9689
dependsOn("generateProto")
9790
manifest {
9891
attributes("Main-Class" to "com.api.igdb.ApiRequesterKt")

src/main/kotlin/com/api/igdb/request/JsonRequest.kt

+8
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ fun IGDBWrapper.jsonGameStatuses(APICalypse: APICalypse): String {
144144
return apiJsonRequest(Endpoints.GAME_STATUSES, APICalypse.buildQuery())
145145
}
146146

147+
@Throws(RequestException::class)
148+
fun IGDBWrapper.jsonGameTimeToBeats(APICalypse: APICalypse): String {
149+
return apiJsonRequest(Endpoints.GAME_TIME_TO_BEATS, APICalypse.buildQuery())
150+
}
151+
147152
@Throws(RequestException::class)
148153
fun IGDBWrapper.jsonGameTypes(APICalypse: APICalypse): String {
149154
return apiJsonRequest(Endpoints.GAME_TYPES, APICalypse.buildQuery())
@@ -298,6 +303,7 @@ fun IGDBWrapper.jsonEvents(APICalypse: APICalypse): String {
298303
fun IGDBWrapper.jsonEventLogos(APICalypse: APICalypse): String {
299304
return apiJsonRequest(Endpoints.EVENT_LOGOS, APICalypse.buildQuery())
300305
}
306+
301307
@Throws(RequestException::class)
302308
fun IGDBWrapper.jsonEventNetworks(APICalypse: APICalypse): String {
303309
return apiJsonRequest(Endpoints.EVENT_NETWORKS, APICalypse.buildQuery())
@@ -307,10 +313,12 @@ fun IGDBWrapper.jsonEventNetworks(APICalypse: APICalypse): String {
307313
fun IGDBWrapper.jsonNetworkTypes(APICalypse: APICalypse): String {
308314
return apiJsonRequest(Endpoints.NETWORK_TYPES, APICalypse.buildQuery())
309315
}
316+
310317
@Throws(RequestException::class)
311318
fun IGDBWrapper.jsonCollectionRelations(APICalypse: APICalypse): String {
312319
return apiJsonRequest(Endpoints.COLLECTION_RELATIONS, APICalypse.buildQuery())
313320
}
321+
314322
@Throws(RequestException::class)
315323
fun IGDBWrapper.jsonCollectionRelationTypes(APICalypse: APICalypse): String {
316324
return apiJsonRequest(Endpoints.COLLECTION_RELATION_TYPES, APICalypse.buildQuery())

src/main/kotlin/com/api/igdb/request/ProtoRequest.kt

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ fun IGDBWrapper.ageRatingCategories(APICalypse: APICalypse): List<AgeRatingCateg
2020
}
2121

2222
@Throws(RequestException::class)
23+
@Deprecated("Use ageRatingContentDescriptionsV2 instead")
2324
fun IGDBWrapper.ageRatingContentDescriptions(APICalypse: APICalypse): List<AgeRatingContentDescription> {
2425
val bytes = apiProtoRequest(Endpoints.AGE_RATING_CONTENT_DESCRIPTIONS, APICalypse.buildQuery())
2526
return AgeRatingContentDescriptionResult.parseFrom(bytes).ageratingcontentdescriptionsList
@@ -175,6 +176,12 @@ fun IGDBWrapper.gameStatuses(APICalypse: APICalypse): List<GameStatus> {
175176
return GameStatusResult.parseFrom(bytes).gamestatusesList
176177
}
177178

179+
@Throws(RequestException::class)
180+
fun IGDBWrapper.gameTimeToBeats(APICalypse: APICalypse): List<GameTimeToBeat> {
181+
val bytes = apiProtoRequest(Endpoints.GAME_TIME_TO_BEATS, APICalypse.buildQuery())
182+
return GameTimeToBeatResult.parseFrom(bytes).gametimetobeatsList
183+
}
184+
178185
@Throws(RequestException::class)
179186
fun IGDBWrapper.gameTypes(APICalypse: APICalypse): List<GameType> {
180187
val bytes = apiProtoRequest(Endpoints.GAME_TYPES, APICalypse.buildQuery())

src/main/kotlin/com/api/igdb/utils/Endpoints.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ enum class Endpoints : Endpoint {
99
COLLECTION_MEMBERSHIP_TYPES, COLLECTION_RELATIONS, COLLECTION_RELATION_TYPES, COLLECTION_TYPES, COLLECTIONS, COMPANIES,
1010
COMPANY_LOGOS, COMPANY_STATUSES, COMPANY_WEBSITES, COVERS, DATE_FORMATS, EVENTS, EVENT_LOGOS,
1111
EVENT_NETWORKS, EXTERNAL_GAMES, EXTERNAL_GAME_SOURCES, FRANCHISES, GAMES, GAME_ENGINES, GAME_ENGINE_LOGOS, GAME_LOCALIZATIONS,
12-
GAME_MODES, GAME_RELEASE_FORMATS, GAME_STATUSES, GAME_TYPES, GAME_VERSIONS, GAME_VERSION_FEATURES, GAME_VERSION_FEATURE_VALUES,
12+
GAME_MODES, GAME_RELEASE_FORMATS, GAME_STATUSES, GAME_TIME_TO_BEATS, GAME_TYPES, GAME_VERSIONS, GAME_VERSION_FEATURES, GAME_VERSION_FEATURE_VALUES,
1313
GAME_VIDEOS, GENRES, INVOLVED_COMPANIES, KEYWORDS, LANGUAGES, LANGUAGE_SUPPORTS, LANGUAGE_SUPPORT_TYPES, MULTIPLAYER_MODES,
1414
NETWORK_TYPES, PLATFORMS, PLATFORM_FAMILIES, PLATFORM_LOGOS, PLATFORM_TYPES, PLATFORM_VERSIONS, PLATFORM_VERSION_COMPANIES,
1515
PLATFORM_VERSION_RELEASE_DATES, PLATFORM_WEBSITES, PLAYER_PERSPECTIVES, POPULARITY_PRIMITIVES, POPULARITY_TYPES, REGIONS,

src/resources/com/api/igdb/igdbproto.proto

+2-1
Original file line numberDiff line numberDiff line change
@@ -1250,10 +1250,11 @@ message PlatformWebsiteResult {
12501250

12511251
message PlatformWebsite {
12521252
uint64 id = 1;
1253-
WebsiteCategoryEnum category = 2;
1253+
WebsiteCategoryEnum category = 2 [deprecated = true];
12541254
bool trusted = 3;
12551255
string url = 4;
12561256
string checksum = 5;
1257+
WebsiteType type = 6;
12571258
}
12581259

12591260
message PlayerPerspectiveResult {

src/test/kotlin/com/api/igdb/TestProtobufRequest.kt

+6
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,12 @@ class TestProtobufRequest {
247247
assert(result.isNotEmpty())
248248
}
249249

250+
@Test
251+
fun testGameTimeToBeats() {
252+
val result = wrapper.gameTimeToBeats(apiCalypseQuery)
253+
assert(result.isNotEmpty())
254+
}
255+
250256
@Test
251257
fun testGameTypes() {
252258
val result = wrapper.gameTypes(apiCalypseQuery)

0 commit comments

Comments
 (0)