From 431f8772f8ad2f30d71bb6565ec2644e4e56c691 Mon Sep 17 00:00:00 2001 From: arkon Date: Wed, 31 May 2023 22:47:31 -0400 Subject: [PATCH] Address minor build warnings --- app/build.gradle.kts | 4 ++-- .../tachiyomi/data/backup/BackupRestorer.kt | 4 ++-- .../tachiyomi/data/coil/MangaCoverFetcher.kt | 2 +- .../data/track/mangaupdates/MangaUpdatesApi.kt | 16 ++++------------ core/build.gradle.kts | 1 + presentation-core/build.gradle.kts | 3 ++- source-local/build.gradle.kts | 8 ++++++++ 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index dc4500b215..93c78c2928 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -279,8 +279,6 @@ tasks { withType { kotlinOptions.freeCompilerArgs += listOf( "-Xcontext-receivers", - "-opt-in=coil.annotation.ExperimentalCoilApi", - "-opt-in=com.google.accompanist.permissions.ExperimentalPermissionsApi", "-opt-in=androidx.compose.foundation.layout.ExperimentalLayoutApi", "-opt-in=androidx.compose.material.ExperimentalMaterialApi", "-opt-in=androidx.compose.material3.ExperimentalMaterial3Api", @@ -289,6 +287,8 @@ tasks { "-opt-in=androidx.compose.foundation.ExperimentalFoundationApi", "-opt-in=androidx.compose.animation.ExperimentalAnimationApi", "-opt-in=androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi", + "-opt-in=coil.annotation.ExperimentalCoilApi", + "-opt-in=com.google.accompanist.permissions.ExperimentalPermissionsApi", "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", "-opt-in=kotlinx.coroutines.FlowPreview", "-opt-in=kotlinx.coroutines.InternalCoroutinesApi", diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt index 0ff0964976..ae4c07c577 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt @@ -125,9 +125,9 @@ class BackupRestorer( } else { // Manga in database // Copy information from manga already in database - val manga = backupManager.restoreExistingManga(manga, dbManga) + val updatedManga = backupManager.restoreExistingManga(manga, dbManga) // Fetch rest of manga information - restoreNewManga(manga, chapters, categories, history, tracks, backupCategories) + restoreNewManga(updatedManga, chapters, categories, history, tracks, backupCategories) } } catch (e: Exception) { val sourceName = sourceMapping[manga.source] ?: manga.source.toString() diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/coil/MangaCoverFetcher.kt b/app/src/main/java/eu/kanade/tachiyomi/data/coil/MangaCoverFetcher.kt index d68a11ccb9..adf033783f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/coil/MangaCoverFetcher.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/coil/MangaCoverFetcher.kt @@ -34,7 +34,7 @@ import java.io.File /** * A [Fetcher] that fetches cover image for [Manga] object. * - * It uses [Manga.thumbnail_url] if custom cover is not set by the user. + * It uses [Manga.thumbnailUrl] if custom cover is not set by the user. * Disk caching for library items is handled by [CoverCache], otherwise * handled by Coil's [DiskCache]. * diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/mangaupdates/MangaUpdatesApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/mangaupdates/MangaUpdatesApi.kt index 45d33a9bdd..1fabe7d4de 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/mangaupdates/MangaUpdatesApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/mangaupdates/MangaUpdatesApi.kt @@ -48,11 +48,7 @@ class MangaUpdatesApi( suspend fun getSeriesListItem(track: Track): Pair { val listItem = with(json) { - authClient.newCall( - GET( - url = "$baseUrl/v1/lists/series/${track.media_id}", - ), - ) + authClient.newCall(GET("$baseUrl/v1/lists/series/${track.media_id}")) .awaitSuccess() .parseAs() } @@ -110,14 +106,10 @@ class MangaUpdatesApi( updateSeriesRating(track) } - suspend fun getSeriesRating(track: Track): Rating? { + private suspend fun getSeriesRating(track: Track): Rating? { return try { with(json) { - authClient.newCall( - GET( - url = "$baseUrl/v1/series/${track.media_id}/rating", - ), - ) + authClient.newCall(GET("$baseUrl/v1/series/${track.media_id}/rating")) .awaitSuccess() .parseAs() } @@ -126,7 +118,7 @@ class MangaUpdatesApi( } } - suspend fun updateSeriesRating(track: Track) { + private suspend fun updateSeriesRating(track: Track) { if (track.score != 0f) { val body = buildJsonObject { put("rating", track.score) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 548d65563f..bfd8e4a88b 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -10,6 +10,7 @@ android { kotlinOptions { freeCompilerArgs += listOf( "-Xcontext-receivers", + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", "-opt-in=kotlinx.serialization.ExperimentalSerializationApi", ) } diff --git a/presentation-core/build.gradle.kts b/presentation-core/build.gradle.kts index cacfc5d594..f7ce6ba62a 100644 --- a/presentation-core/build.gradle.kts +++ b/presentation-core/build.gradle.kts @@ -38,7 +38,6 @@ tasks { // See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers) withType { kotlinOptions.freeCompilerArgs += listOf( - "-opt-in=coil.annotation.ExperimentalCoilApi", "-opt-in=androidx.compose.foundation.layout.ExperimentalLayoutApi", "-opt-in=androidx.compose.material.ExperimentalMaterialApi", "-opt-in=androidx.compose.material3.ExperimentalMaterial3Api", @@ -47,6 +46,8 @@ tasks { "-opt-in=androidx.compose.foundation.ExperimentalFoundationApi", "-opt-in=androidx.compose.animation.ExperimentalAnimationApi", "-opt-in=androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi", + "-opt-in=coil.annotation.ExperimentalCoilApi", + "-opt-in=kotlinx.coroutines.FlowPreview", ) } } diff --git a/source-local/build.gradle.kts b/source-local/build.gradle.kts index 0f6ad1fc26..19885316ce 100644 --- a/source-local/build.gradle.kts +++ b/source-local/build.gradle.kts @@ -35,3 +35,11 @@ android { consumerProguardFiles("consumer-rules.pro") } } + +tasks { + withType { + kotlinOptions.freeCompilerArgs += listOf( + "-opt-in=kotlinx.serialization.ExperimentalSerializationApi", + ) + } +}