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.protobuf)
|
||||||
alias(libs.plugins.kotlin.plugin.serialization)
|
alias(libs.plugins.kotlin.plugin.serialization)
|
||||||
alias(libs.plugins.aboutLibraries)
|
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
|
val isCI = if (System.getenv("CI") != null) System.getenv("CI").toBoolean() else false
|
||||||
|
|
@ -70,6 +71,14 @@ android {
|
||||||
jvmTarget = JvmTarget.JVM_11
|
jvmTarget = JvmTarget.JVM_11
|
||||||
javaParameters = true
|
javaParameters = true
|
||||||
}
|
}
|
||||||
|
// sourceSets {
|
||||||
|
// main {
|
||||||
|
// java.srcDirs +=
|
||||||
|
// kotlin {
|
||||||
|
// srcDirs += files("$buildDir/generated/seerr_api/src/main/kotlin")
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
buildConfig = true
|
buildConfig = true
|
||||||
|
|
@ -144,6 +153,12 @@ android {
|
||||||
isUniversalApk = true
|
isUniversalApk = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
getByName("main") {
|
||||||
|
kotlin.srcDirs("$buildDir/generated/seerr_api/src/main/kotlin")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protobuf {
|
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 {
|
dependencies {
|
||||||
implementation(libs.androidx.core.ktx)
|
implementation(libs.androidx.core.ktx)
|
||||||
implementation(libs.androidx.appcompat)
|
implementation(libs.androidx.appcompat)
|
||||||
|
|
@ -238,6 +277,8 @@ dependencies {
|
||||||
implementation(libs.acra.limiter)
|
implementation(libs.acra.limiter)
|
||||||
compileOnly(libs.auto.service.annotations)
|
compileOnly(libs.auto.service.annotations)
|
||||||
ksp(libs.auto.service.ksp)
|
ksp(libs.auto.service.ksp)
|
||||||
|
implementation(platform(libs.okhttp.bom))
|
||||||
|
implementation(libs.okhttp)
|
||||||
|
|
||||||
androidTestImplementation(platform(libs.androidx.compose.bom))
|
androidTestImplementation(platform(libs.androidx.compose.bom))
|
||||||
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
|
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
|
||||||
|
|
@ -248,5 +289,5 @@ dependencies {
|
||||||
implementation(files("libs/lib-decoder-ffmpeg-release.aar"))
|
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.Call
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
|
|
||||||
|
|
@ -2,7 +2,7 @@ package com.github.damontecres.wholphin.services
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.SharedPreferences
|
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 dagger.hilt.android.qualifiers.ApplicationContext
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
|
|
||||||
|
|
@ -15,7 +15,7 @@ class SeerrApi(
|
||||||
|
|
||||||
var api: SeerrApiClient =
|
var api: SeerrApiClient =
|
||||||
SeerrApiClient(
|
SeerrApiClient(
|
||||||
prefs.getString("baseUrl", null)!!,
|
prefs.getString("baseUrl", null)!! + "/api/v1",
|
||||||
prefs.getString("apiKey", null)!!,
|
prefs.getString("apiKey", null)!!,
|
||||||
okHttpClient,
|
okHttpClient,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.github.damontecres.wholphin.services
|
package com.github.damontecres.wholphin.services
|
||||||
|
|
||||||
import com.github.damontecres.api.seerr.SeerrApiClient
|
import com.github.damontecres.wholphin.api.seerr.SeerrApiClient
|
||||||
import com.github.damontecres.api.seerr.model.SearchGet200ResponseResultsInner
|
import com.github.damontecres.wholphin.api.seerr.model.SearchGet200ResponseResultsInner
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -243,13 +243,12 @@ fun DestinationContent(
|
||||||
DebugPage(preferences, modifier)
|
DebugPage(preferences, modifier)
|
||||||
}
|
}
|
||||||
|
|
||||||
Destination.Discover ->
|
Destination.Discover -> {
|
||||||
SeerrDiscoverPage(
|
SeerrDiscoverPage(
|
||||||
preferences = preferences,
|
preferences = preferences,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -188,6 +188,13 @@ sealed interface NavDrawerItem {
|
||||||
|
|
||||||
override fun name(context: Context): String = context.getString(R.string.more)
|
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(
|
data class ServerNavDrawerItem(
|
||||||
|
|
@ -262,6 +269,13 @@ fun NavDrawer(
|
||||||
setShowMore(!showMore)
|
setShowMore(!showMore)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NavDrawerItem.Discover -> {
|
||||||
|
viewModel.setIndex(index)
|
||||||
|
viewModel.navigationManager.navigateToFromDrawer(
|
||||||
|
Destination.Discover,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
is ServerNavDrawerItem -> {
|
is ServerNavDrawerItem -> {
|
||||||
viewModel.setIndex(index)
|
viewModel.setIndex(index)
|
||||||
viewModel.navigationManager.navigateToFromDrawer(item.destination)
|
viewModel.navigationManager.navigateToFromDrawer(item.destination)
|
||||||
|
|
@ -606,6 +620,11 @@ fun NavigationDrawerScope.NavItem(
|
||||||
R.string.fa_ellipsis
|
R.string.fa_ellipsis
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NavDrawerItem.Discover -> {
|
||||||
|
// TODO seerr
|
||||||
|
R.string.fa_list_ul
|
||||||
|
}
|
||||||
|
|
||||||
is ServerNavDrawerItem -> {
|
is ServerNavDrawerItem -> {
|
||||||
when (library.type) {
|
when (library.type) {
|
||||||
CollectionType.MOVIES -> R.string.fa_film
|
CollectionType.MOVIES -> R.string.fa_film
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import androidx.tv.material3.Text
|
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.preferences.UserPreferences
|
||||||
import com.github.damontecres.wholphin.services.SeerrService
|
import com.github.damontecres.wholphin.services.SeerrService
|
||||||
import com.github.damontecres.wholphin.ui.launchIO
|
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()
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
// maven {
|
|
||||||
// url = uri("https://androidx.dev/snapshots/builds/14137143/artifacts/repository")
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
|
|
@ -19,12 +16,8 @@ dependencyResolutionManagement {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
// maven {
|
|
||||||
// url = uri("https://androidx.dev/snapshots/builds/14137143/artifacts/repository")
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = "Wholphin"
|
rootProject.name = "Wholphin"
|
||||||
include(":app")
|
include(":app")
|
||||||
include(":seerr-api")
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue