diff --git a/app/src/main/java/org/jellyfin/androidtv/di/PlaybackModule.kt b/app/src/main/java/org/jellyfin/androidtv/di/PlaybackModule.kt index 3c6154442c..fd0fcd5a79 100644 --- a/app/src/main/java/org/jellyfin/androidtv/di/PlaybackModule.kt +++ b/app/src/main/java/org/jellyfin/androidtv/di/PlaybackModule.kt @@ -16,7 +16,6 @@ val playbackModule = module { val preferences = get() val useRewrite = preferences[UserPreferences.playbackRewriteEnabled] && BuildConfig.DEVELOPMENT - // TODO Inject PlaybackLauncher for playback rewrite here if (useRewrite) RewritePlaybackLauncher() else GarbagePlaybackLauncher(get()) } diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/playback/rewrite/PlaybackForwardingActivity.kt b/app/src/main/java/org/jellyfin/androidtv/ui/playback/rewrite/PlaybackForwardingActivity.kt index 7d94748e17..118e8bdc15 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/playback/rewrite/PlaybackForwardingActivity.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/playback/rewrite/PlaybackForwardingActivity.kt @@ -31,9 +31,9 @@ class PlaybackForwardingActivity : FragmentActivity() { if (itemId == null) { Toast.makeText( - this, - "Could not find item to play (itemId=null)", - Toast.LENGTH_LONG + this, + "Could not find item to play (itemId=null)", + Toast.LENGTH_LONG ).show() finishAfterTransition() return @@ -45,9 +45,9 @@ class PlaybackForwardingActivity : FragmentActivity() { // Log info Toast.makeText( - this@PlaybackForwardingActivity, - "Found item of type ${item.type} - ${item.name} (${item.id}", - Toast.LENGTH_LONG + this@PlaybackForwardingActivity, + "Found item of type ${item.type} - ${item.name} (${item.id}", + Toast.LENGTH_LONG ).show() Timber.i(item.toString()) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a7bd68d03a..80f10f18a6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,6 +11,7 @@ androidx-core = "1.7.0" androidx-fragment = "1.4.0" androidx-leanback = "1.1.0-rc01" androidx-lifecycle = "2.4.1" +androidx-media2 = "1.2.1" androidx-preference = "1.1.1" androidx-recyclerview = "1.2.1" androidx-startup = "1.1.1" @@ -27,6 +28,7 @@ jellyfin-sdk = "1.2.0-beta.2" junit = "4.13.2" kenburnsview = "1.0.7" koin = "3.1.4" +kotest = "5.1.0" kotlin = "1.6.10" kotlinx-coroutines = "1.5.2" kotlinx-serialization = "1.3.1" @@ -36,7 +38,6 @@ markwon = "4.6.2" mockk = "1.12.1" slf4j-timber = "3.1" timber = "5.0.1" -kotest = "5.1.0" [plugins] aboutlibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "aboutlibraries" } @@ -51,6 +52,7 @@ jellyfin-sdk = { module = "org.jellyfin.sdk:jellyfin-core", version.ref = "jelly # Kotlin kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" } +kotlinx-coroutines-guava = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-guava", version.ref = "kotlinx-coroutines" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" } # Android(x) @@ -67,6 +69,7 @@ androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" } androidx-lifecycle-service = { module = "androidx.lifecycle:lifecycle-service", version.ref = "androidx-lifecycle" } androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" } +androidx-media2-session = { module = "androidx.media2:media2-session", version.ref = "androidx-media2" } androidx-preference = { module = "androidx.preference:preference-ktx", version.ref = "androidx-preference" } androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidx-recyclerview" } androidx-startup = { module = "androidx.startup:startup-runtime", version.ref = "androidx-startup" } diff --git a/playback/build.gradle.kts b/playback/build.gradle.kts index 3a5a9b5d98..29ccc1c52e 100644 --- a/playback/build.gradle.kts +++ b/playback/build.gradle.kts @@ -22,8 +22,39 @@ android { lintConfig = file("$rootDir/android-lint.xml") abortOnError = false } + + testOptions.unitTests.all { + it.useJUnitPlatform() + } } dependencies { + // Jellyfin + compileOnly(libs.jellyfin.sdk) + + // Kotlin + implementation(libs.kotlinx.coroutines) + implementation(libs.kotlinx.coroutines.guava) + implementation(libs.kotlinx.serialization.json) + + // Android(x) + implementation(libs.androidx.core) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.constraintlayout) + implementation(libs.bundles.androidx.lifecycle) + + // Dependency Injection + implementation(libs.bundles.koin) + + // Media + implementation(libs.exoplayer) + implementation(libs.androidx.media2.session) + + // Logging + implementation(libs.timber) + // Testing + testImplementation(libs.kotest.runner.junit5) + testImplementation(libs.kotest.assertions) + testImplementation(libs.mockk) }