mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Move seer-api into app
This commit is contained in:
parent
b87d81513a
commit
d08bd40a68
11 changed files with 70 additions and 78 deletions
|
|
@ -15,6 +15,7 @@ plugins {
|
|||
alias(libs.plugins.protobuf)
|
||||
alias(libs.plugins.kotlin.plugin.serialization)
|
||||
alias(libs.plugins.aboutLibraries)
|
||||
id("org.openapi.generator") version "7.17.0"
|
||||
}
|
||||
|
||||
val isCI = if (System.getenv("CI") != null) System.getenv("CI").toBoolean() else false
|
||||
|
|
@ -70,6 +71,14 @@ android {
|
|||
jvmTarget = JvmTarget.JVM_11
|
||||
javaParameters = true
|
||||
}
|
||||
// sourceSets {
|
||||
// main {
|
||||
// java.srcDirs +=
|
||||
// kotlin {
|
||||
// srcDirs += files("$buildDir/generated/seerr_api/src/main/kotlin")
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
|
|
@ -144,6 +153,12 @@ android {
|
|||
isUniversalApk = true
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
getByName("main") {
|
||||
kotlin.srcDirs("$buildDir/generated/seerr_api/src/main/kotlin")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protobuf {
|
||||
|
|
@ -175,6 +190,30 @@ aboutLibraries {
|
|||
}
|
||||
}
|
||||
|
||||
openApiGenerate {
|
||||
generatorName.set("kotlin")
|
||||
inputSpec.set("$projectDir/src/main/seerr-api.yml")
|
||||
outputDir.set("$buildDir/generated/seerr_api")
|
||||
apiPackage.set("com.github.damontecres.wholphin.api.seerr")
|
||||
modelPackage.set("com.github.damontecres.wholphin.api.seerr.model")
|
||||
groupId.set("com.github.damontecres.wholphin.api.seerr")
|
||||
id.set("seerr-api")
|
||||
packageName.set("com.github.damontecres.wholphin.api.seerr")
|
||||
additionalProperties.apply {
|
||||
put("serializationLibrary", "kotlinx_serialization")
|
||||
put("sortModelPropertiesByRequiredFlag", true)
|
||||
put("sortParamsByRequiredFlag", true)
|
||||
put("useCoroutines", true)
|
||||
put("enumPropertyNaming", "UPPERCASE")
|
||||
put("modelMutable", false)
|
||||
put("supportAndroidApiLevel25AndBelow", true)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("preBuild") {
|
||||
dependsOn.add(tasks.named("openApiGenerate"))
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.appcompat)
|
||||
|
|
@ -238,6 +277,8 @@ dependencies {
|
|||
implementation(libs.acra.limiter)
|
||||
compileOnly(libs.auto.service.annotations)
|
||||
ksp(libs.auto.service.ksp)
|
||||
implementation(platform(libs.okhttp.bom))
|
||||
implementation(libs.okhttp)
|
||||
|
||||
androidTestImplementation(platform(libs.androidx.compose.bom))
|
||||
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
|
||||
|
|
@ -248,5 +289,5 @@ dependencies {
|
|||
implementation(files("libs/lib-decoder-ffmpeg-release.aar"))
|
||||
}
|
||||
|
||||
implementation(project(":seerr-api"))
|
||||
// implementation(project(":seerr-api"))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.github.damontecres.api.seerr
|
||||
package com.github.damontecres.wholphin.api.seerr
|
||||
|
||||
import com.github.damontecres.api.seerr.infrastructure.ApiClient
|
||||
import com.github.damontecres.wholphin.api.seerr.infrastructure.ApiClient
|
||||
import okhttp3.Call
|
||||
import okhttp3.OkHttpClient
|
||||
|
||||
|
|
@ -2,7 +2,7 @@ package com.github.damontecres.wholphin.services
|
|||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import com.github.damontecres.api.seerr.SeerrApiClient
|
||||
import com.github.damontecres.wholphin.api.seerr.SeerrApiClient
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import okhttp3.OkHttpClient
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ class SeerrApi(
|
|||
|
||||
var api: SeerrApiClient =
|
||||
SeerrApiClient(
|
||||
prefs.getString("baseUrl", null)!!,
|
||||
prefs.getString("baseUrl", null)!! + "/api/v1",
|
||||
prefs.getString("apiKey", null)!!,
|
||||
okHttpClient,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.github.damontecres.wholphin.services
|
||||
|
||||
import com.github.damontecres.api.seerr.SeerrApiClient
|
||||
import com.github.damontecres.api.seerr.model.SearchGet200ResponseResultsInner
|
||||
import com.github.damontecres.wholphin.api.seerr.SeerrApiClient
|
||||
import com.github.damontecres.wholphin.api.seerr.model.SearchGet200ResponseResultsInner
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
|
|
|||
|
|
@ -243,13 +243,12 @@ fun DestinationContent(
|
|||
DebugPage(preferences, modifier)
|
||||
}
|
||||
|
||||
Destination.Discover ->
|
||||
Destination.Discover -> {
|
||||
SeerrDiscoverPage(
|
||||
preferences = preferences,
|
||||
modifier = modifier,
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -188,6 +188,13 @@ sealed interface NavDrawerItem {
|
|||
|
||||
override fun name(context: Context): String = context.getString(R.string.more)
|
||||
}
|
||||
|
||||
object Discover : NavDrawerItem {
|
||||
override val id: String
|
||||
get() = "a_discover"
|
||||
|
||||
override fun name(context: Context): String = context.getString(R.string.discover)
|
||||
}
|
||||
}
|
||||
|
||||
data class ServerNavDrawerItem(
|
||||
|
|
@ -262,6 +269,13 @@ fun NavDrawer(
|
|||
setShowMore(!showMore)
|
||||
}
|
||||
|
||||
NavDrawerItem.Discover -> {
|
||||
viewModel.setIndex(index)
|
||||
viewModel.navigationManager.navigateToFromDrawer(
|
||||
Destination.Discover,
|
||||
)
|
||||
}
|
||||
|
||||
is ServerNavDrawerItem -> {
|
||||
viewModel.setIndex(index)
|
||||
viewModel.navigationManager.navigateToFromDrawer(item.destination)
|
||||
|
|
@ -606,6 +620,11 @@ fun NavigationDrawerScope.NavItem(
|
|||
R.string.fa_ellipsis
|
||||
}
|
||||
|
||||
NavDrawerItem.Discover -> {
|
||||
// TODO seerr
|
||||
R.string.fa_list_ul
|
||||
}
|
||||
|
||||
is ServerNavDrawerItem -> {
|
||||
when (library.type) {
|
||||
CollectionType.MOVIES -> R.string.fa_film
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import androidx.lifecycle.MutableLiveData
|
|||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import androidx.tv.material3.Text
|
||||
import com.github.damontecres.api.seerr.model.MovieResult
|
||||
import com.github.damontecres.wholphin.api.seerr.model.MovieResult
|
||||
import com.github.damontecres.wholphin.preferences.UserPreferences
|
||||
import com.github.damontecres.wholphin.services.SeerrService
|
||||
import com.github.damontecres.wholphin.ui.launchIO
|
||||
|
|
|
|||
1
seerr-api/.gitignore
vendored
1
seerr-api/.gitignore
vendored
|
|
@ -1 +0,0 @@
|
|||
/build
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
plugins {
|
||||
id("java-library")
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
id("org.openapi.generator") version "7.17.0"
|
||||
}
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
kotlin.srcDirs("$buildDir/generated/seerr_api/src/main/kotlin")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
openApiGenerate {
|
||||
generatorName.set("kotlin")
|
||||
inputSpec.set("$projectDir/src/main/seerr-api.yml")
|
||||
outputDir.set("$buildDir/generated/seerr_api")
|
||||
apiPackage.set("com.github.damontecres.api.seerr")
|
||||
modelPackage.set("com.github.damontecres.api.seerr.model")
|
||||
groupId.set("com.github.damontecres.api.seerr")
|
||||
id.set("seerr-api")
|
||||
packageName.set("com.github.damontecres.api.seerr")
|
||||
additionalProperties.apply {
|
||||
put("serializationLibrary", "kotlinx_serialization")
|
||||
put("sortModelPropertiesByRequiredFlag", true)
|
||||
put("sortParamsByRequiredFlag", true)
|
||||
put("useCoroutines", true)
|
||||
put("enumPropertyNaming", "UPPERCASE")
|
||||
put("modelMutable", false)
|
||||
}
|
||||
// typeMappings.set(
|
||||
// mapOf(
|
||||
// "number" to "kotlin.Int",
|
||||
// "integer" to "kotlin.Int",
|
||||
// "int32" to "kotlin.Int",
|
||||
// "int64" to "kotlin.Long",
|
||||
// ),
|
||||
// )
|
||||
}
|
||||
|
||||
tasks.named("compileKotlin") {
|
||||
dependsOn.add(tasks.named("openApiGenerate"))
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(platform(libs.okhttp.bom))
|
||||
implementation(libs.okhttp)
|
||||
implementation(libs.kotlinx.serialization.core)
|
||||
implementation(libs.kotlinx.serialization.json)
|
||||
implementation(libs.kotlinx.coroutines.core)
|
||||
}
|
||||
|
|
@ -9,9 +9,6 @@ pluginManagement {
|
|||
}
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
// maven {
|
||||
// url = uri("https://androidx.dev/snapshots/builds/14137143/artifacts/repository")
|
||||
// }
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
|
|
@ -19,12 +16,8 @@ dependencyResolutionManagement {
|
|||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// maven {
|
||||
// url = uri("https://androidx.dev/snapshots/builds/14137143/artifacts/repository")
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "Wholphin"
|
||||
include(":app")
|
||||
include(":seerr-api")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue