Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update playback rewrite build files #1626

Merged
merged 1 commit into from
Apr 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ val playbackModule = module {
val preferences = get<UserPreferences>()
val useRewrite = preferences[UserPreferences.playbackRewriteEnabled] && BuildConfig.DEVELOPMENT

// TODO Inject PlaybackLauncher for playback rewrite here
if (useRewrite) RewritePlaybackLauncher()
else GarbagePlaybackLauncher(get())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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())

Expand Down
5 changes: 4 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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" }
Expand All @@ -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)
Expand All @@ -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" }
Expand Down
31 changes: 31 additions & 0 deletions playback/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}