diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/Hikka.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/Hikka.kt index 48d5e5926..12524e716 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/Hikka.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/Hikka.kt @@ -12,9 +12,9 @@ import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json -import tachiyomi.domain.track.model.Track as DomainTrack import tachiyomi.i18n.MR import uy.kohesive.injekt.injectLazy +import tachiyomi.domain.track.model.Track as DomainTrack class Hikka(id: Long) : BaseTracker(id, "Hikka"), DeletableTracker { @@ -51,7 +51,7 @@ class Hikka(id: Long) : BaseTracker(id, "Hikka"), DeletableTracker { ON_HOLD, DROPPED, PLAN_TO_READ, - REREADING + REREADING, ) } @@ -132,7 +132,7 @@ class Hikka(id: Long) : BaseTracker(id, "Hikka"), DeletableTracker { try { val oauth = api.accessToken(code) interceptor.setAuth(oauth) - val user = api.getCurrentUser() + val user = api.getCurrentUser() saveCredentials(user.reference, oauth.accessToken) } catch (e: Throwable) { logout() diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/HikkaApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/HikkaApi.kt index 4852fdd2e..18108ddb6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/HikkaApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/HikkaApi.kt @@ -79,19 +79,25 @@ class HikkaApi( put("only_translated", false) put("magazines", buildJsonArray { }) put("genres", buildJsonArray { }) - put("score", buildJsonArray { - add(0) - add(10) - }) + put( + "score", + buildJsonArray { + add(0) + add(10) + }, + ) put("query", query) - put("sort", buildJsonArray { - add("score:asc") - add("scored_by:asc") - }) + put( + "sort", + buildJsonArray { + add("score:asc") + add("scored_by:asc") + }, + ) } with(json) { - authClient.newCall(POST(url.toString(), body=payload.toString().toRequestBody(jsonMime))) + authClient.newCall(POST(url.toString(), body = payload.toString().toRequestBody(jsonMime))) .awaitSuccess() .parseAs() .list @@ -103,7 +109,7 @@ class HikkaApi( private suspend fun getRead(track: Track): HKRead? { return withIOContext { val slug = track.tracking_url.split("/")[4] - val url = "$BASE_API_URL/read/manga/${slug}".toUri().buildUpon().build() + val url = "$BASE_API_URL/read/manga/$slug".toUri().buildUpon().build() with(json) { val response = authClient.newCall(GET(url.toString())).execute() if (response.code == 404) { @@ -120,7 +126,7 @@ class HikkaApi( return withIOContext { val slug = track.tracking_url.split("/")[4] - val url = "$BASE_API_URL/manga/${slug}".toUri().buildUpon() + val url = "$BASE_API_URL/manga/$slug".toUri().buildUpon() .build() with(json) { @@ -136,7 +142,7 @@ class HikkaApi( return withIOContext { val slug = track.remoteUrl.split("/")[4] - val url = "$BASE_API_URL/read/manga/${slug}".toUri().buildUpon() + val url = "$BASE_API_URL/read/manga/$slug".toUri().buildUpon() .build() authClient.newCall(DELETE(url.toString())) @@ -148,7 +154,7 @@ class HikkaApi( return withIOContext { val slug = track.tracking_url.split("/")[4] - val url = "$BASE_API_URL/read/manga/${slug}".toUri().buildUpon() + val url = "$BASE_API_URL/read/manga/$slug".toUri().buildUpon() .build() var rereads = getRead(track)?.rereads ?: 0 @@ -166,7 +172,7 @@ class HikkaApi( } with(json) { - authClient.newCall(PUT(url.toString(), body=payload.toString().toRequestBody(jsonMime))) + authClient.newCall(PUT(url.toString(), body = payload.toString().toRequestBody(jsonMime))) .awaitSuccess() .parseAs() .toTrack(trackId) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKAuthTokenInfo.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKAuthTokenInfo.kt index 13f8233d3..7f0e096a6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKAuthTokenInfo.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKAuthTokenInfo.kt @@ -9,5 +9,5 @@ data class HKAuthTokenInfo( val client: HKClient, val scope: List, val expiration: Long, - val used: Long + val used: Long, ) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKClient.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKClient.kt index 98af1651a..824cffbb9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKClient.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKClient.kt @@ -10,5 +10,5 @@ data class HKClient( val verified: Boolean, val user: HKUser, val created: Long, - val updated: Long + val updated: Long, ) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKManga.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKManga.kt index 8f7990ba6..ff35a5b13 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKManga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKManga.kt @@ -21,7 +21,7 @@ data class HKManga( val year: Int, @SerialName("scored_by") val scoredBy: Int, val score: Double, - val slug: String + val slug: String, ) { fun toTrack(trackId: Long): TrackSearch { return TrackSearch.create(trackId).apply { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKMangaPagination.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKMangaPagination.kt index 77641cbc2..a8245fe65 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKMangaPagination.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKMangaPagination.kt @@ -5,5 +5,5 @@ import kotlinx.serialization.Serializable @Serializable data class HKMangaPagination( val pagination: HKPagination, - val list: List + val list: List, ) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKPagination.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKPagination.kt index d5b056175..3c7e5f2c7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKPagination.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKPagination.kt @@ -6,5 +6,5 @@ import kotlinx.serialization.Serializable data class HKPagination( val total: Int, val pages: Int, - val page: Int + val page: Int, ) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKRead.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKRead.kt index 80093a278..7d95ec242 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKRead.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKRead.kt @@ -17,7 +17,7 @@ data class HKRead( val volumes: Int, val rereads: Int, val score: Int, - val content: HKManga + val content: HKManga, ) { fun toTrack(trackId: Long): TrackSearch { return TrackSearch.create(trackId).apply { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKUser.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKUser.kt index 5541eea70..4210c6b16 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKUser.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/hikka/dto/HKUser.kt @@ -12,5 +12,5 @@ data class HKUser( val cover: String, val active: Boolean, val avatar: String, - val role: String + val role: String, )