Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a577ae9
Add option to prefer Dolby Vision over HDR10+ on hybrid videos (#1876)
Jycreyn Sep 29, 2026
cf74736
Listen for user config changes and improved websocket error handling …
damontecres Sep 29, 2026
b0d2703
Better home page header for Seasons (#2016)
damontecres Sep 30, 2026
559abe2
Add setting to force transcoding above a max resolution (#1955)
damontecres Oct 3, 2026
f5dedea
Fix baseline profile never being installed (#1984)
AyazP Oct 4, 2026
a38eb3e
Fix possible crash on a few pages due to color space (#2036)
damontecres Oct 7, 2026
b99f21e
Various bug fixes (#2010)
damontecres Oct 8, 2026
e23c446
Fix issue when scrolling on collection details page (#2048)
damontecres Oct 8, 2026
d6523ce
Fixes restoring focus on the correct episode (#2051)
damontecres Oct 9, 2026
0e11b8f
Translated using Weblate (Slovak)
Sep 13, 2026
22254ba
Translated using Weblate (Chinese (Traditional Han script))
Sep 13, 2026
c0eceba
Translated using Weblate (German)
Sep 14, 2026
29e235f
Translated using Weblate (Estonian)
Sep 14, 2026
0e0d507
Translated using Weblate (Portuguese)
Sep 14, 2026
121208e
Translated using Weblate (Turkish)
Sep 14, 2026
26d3e5b
Translated using Weblate (Russian)
Sep 15, 2026
e4c3257
Translated using Weblate (Croatian)
Sep 16, 2026
b03325a
Translated using Weblate (English (United Kingdom))
andibing Sep 16, 2026
4502a12
Translated using Weblate (Swedish)
Sep 18, 2026
ba5351f
Translated using Weblate (Swedish)
Sep 20, 2026
6308ad8
Translated using Weblate (Russian)
Sep 21, 2026
c879a57
Translated using Weblate (Chinese (Simplified Han script))
Sep 27, 2026
68c48f1
Translated using Weblate (Spanish)
Sep 29, 2026
f14e5a5
Translated using Weblate (Spanish)
Oct 2, 2026
55d3254
Translated using Weblate (Swedish)
Oct 2, 2026
db77aaa
Translated using Weblate (Polish)
Oct 4, 2026
1571591
Translated using Weblate (Swedish)
Oct 5, 2026
9b02804
Translations 2026-10 -10 (#2054)
damontecres Oct 11, 2026
5bfbba1
Fix issue with home reloading on user switch (#2064)
damontecres Oct 11, 2026
2d87d52
Release v1.0.9
damontecres Oct 11, 2026
d0640f1
Update Kotlin to v2.4.21 (#2057)
renovate[bot] Oct 12, 2026
56836f6
Update actions/upload-artifact digest to cf430e0 (#2056)
renovate[bot] Oct 12, 2026
26659b3
Update dependency org.openapi.generator to v7.26.0 (#2058)
renovate[bot] Oct 12, 2026
a11cd9f
Update Gradle to v9.8.1 (#1818)
renovate[bot] Oct 12, 2026
f01c5d3
Updates to session restoration (#1905)
damontecres Oct 12, 2026
9f55741
New user preference to force enable or disable common HDR and Dolby V…
whitingj Oct 13, 2026
55960c2
Inherit parent view options and sort for sub-folders (#2045)
mizuka123 Oct 16, 2026
b779bd8
merge: integrate Wholphin upstream Stage B
constbogdan Nov 6, 2026
32b37b8
test: update approved Gradle wrapper pin for Stage B
constbogdan Nov 6, 2026
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
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ dependencies {
implementation(libs.androidx.tvprovider)
implementation(libs.androidx.work.runtime.ktx)
implementation(libs.androidx.hilt.work)
implementation(libs.androidx.profileinstaller)

implementation(libs.androidx.media3.exoplayer)
implementation(libs.androidx.media3.session)
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
tools:node="remove" />
tools:node="merge">
<meta-data
android:name="androidx.work.WorkManagerInitializer"
android:value="androidx.startup"
tools:node="remove" />
</provider>

<service
android:name=".WholphinDreamService"
Expand Down
221 changes: 112 additions & 109 deletions app/src/main/java/com/github/damontecres/wholphin/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.view.WindowManager
import android.widget.Toast
import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.annotation.VisibleForTesting
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -77,7 +78,6 @@ import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.firstOrNull
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
Expand All @@ -86,7 +86,6 @@ import kotlinx.coroutines.sync.withLock
import kotlinx.coroutines.withContext
import kotlinx.serialization.json.Json
import okhttp3.OkHttpClient
import org.jellyfin.sdk.model.serializer.toUUIDOrNull
import timber.log.Timber
import javax.inject.Inject
import kotlin.time.Duration.Companion.milliseconds
Expand Down Expand Up @@ -443,120 +442,27 @@ class MainActivityViewModel
viewModelScope.launchDefault {
mutex.withLock {
try {
val result = intent?.let { intentService.parseIntent(intent) }
when (result) {
is IntentResult.Error -> {
val current = serverRepository.current.value
val destination =
if (current != null) {
SetupDestination.UserList(current.server)
} else {
SetupDestination.ServerList
}
setupNavigationManager.navigateTo(destination)
Timber.e("Error parsing intent: %s", result.message)
showToast(context, result.message)
return@withLock
}

is IntentResult.Target -> {
val current = serverRepository.current.value
if (current != null) {
Timber.i("Received valid intent, switching to AppContent")

if (result.addHomeToBackStack) {
navigationManager.reloadHome()
} else {
navigationManager.backStack.clear()
}
navigationManager.backStack.addAll(result.destinations)

setupNavigationManager.navigateTo(
SetupDestination.AppContent(current),
)
} else {
// This should never happen, but just reset app state if it does
setupNavigationManager.navigateTo(SetupDestination.ServerList)
Timber.e("Error parsing intent, no user is active")
showToast(context, "An error occurred parsing the intent")
}
return@withLock
}
handleAppUpgrade()
} catch (ex: Exception) {
Timber.e(ex, "Error during app upgrade!")
showToast(
context,
"Error during app upgrade: ${ex.localizedMessage}",
)
}

IntentResult.NoOp,
null,
-> {
// No-op, proceed below
}
try {
val result = handleIntent(intent)
if (result) {
Timber.i("appStart was handled by intent")
return@withLock
}
} catch (ex: Exception) {
Timber.e(ex, "Error parsing intent")
}

try {
val needUpgrade = appUpgradeHandler.needUpgrade()
if (needUpgrade) {
showToast(
context,
context.getString(
R.string.updated_toast,
appUpgradeHandler.currentVersion.toString(),
),
)
appUpgradeHandler.run()
}
appUpgradeHandler.copySubfont(false)
val prefs =
preferences.data.firstOrNull() ?: AppPreferences.getDefaultInstance()
val profileProtected =
serverRepository.current.value
?.user
?.isProtected == true
if (prefs.signInAutomatically && !profileProtected) {
val current =
serverRepository.restoreSession(
prefs.currentServerId?.toUUIDOrNull(),
prefs.currentUserId?.toUUIDOrNull(),
)
if (current != null) {
if (current.user.isProtected) {
setupNavigationManager.navigateTo(
SetupDestination.UserList(
current.server,
),
)
} else {
// Restored
setupNavigationManager.navigateTo(
SetupDestination.AppContent(
current,
),
)
}
} else {
// Did not restore
setupNavigationManager.navigateTo(SetupDestination.ServerList)
}
} else {
setupNavigationManager.navigateTo(SetupDestination.Loading)
backdropService.clearBackdrop()
val currentServerId = prefs.currentServerId?.toUUIDOrNull()
if (currentServerId != null) {
val currentServer =
serverRepository.serverDao.getServer(currentServerId)?.server
if (currentServer != null) {
setupNavigationManager.navigateTo(
SetupDestination.UserList(
currentServer,
),
)
} else {
setupNavigationManager.navigateTo(SetupDestination.ServerList)
}
} else {
setupNavigationManager.navigateTo(SetupDestination.ServerList)
}
}
handleAppStart()
} catch (ex: Exception) {
Timber.e(ex, "Error during appStart")
setupNavigationManager.navigateTo(SetupDestination.ServerList)
Expand All @@ -581,6 +487,103 @@ class MainActivityViewModel
}
}
}

/**
* Handle an [Intent], navigating if needed
*
* @return true if the intent was handled, false if normal app start should proceed
*/
@VisibleForTesting
internal suspend fun handleIntent(intent: Intent?): Boolean {
val result = intent?.let { intentService.parseIntent(intent) }
when (result) {
is IntentResult.Error -> {
val current = serverRepository.current.value
val destination =
if (current != null) {
SetupDestination.UserList(current.server)
} else {
SetupDestination.ServerList
}
setupNavigationManager.navigateTo(destination)
Timber.e("Error parsing intent: %s", result.message)
showToast(context, result.message)
return true
}

is IntentResult.Target -> {
val current = serverRepository.current.value
if (current != null) {
Timber.i("Received valid intent, switching to AppContent")

if (result.addHomeToBackStack) {
navigationManager.reloadHome()
} else {
navigationManager.backStack.clear()
}
navigationManager.backStack.addAll(result.destinations)

setupNavigationManager.navigateTo(
SetupDestination.AppContent(current),
)
} else {
// This should never happen, but just reset app state if it does
setupNavigationManager.navigateTo(SetupDestination.ServerList)
Timber.e("Error parsing intent, no user is active")
showToast(context, "An error occurred parsing the intent")
}
return true
}

IntentResult.NoOp,
null,
-> {
// Not handled
return false
}
}
}

private suspend fun handleAppUpgrade() {
val needUpgrade = appUpgradeHandler.needUpgrade()
if (needUpgrade) {
showToast(
context,
context.getString(
R.string.updated_toast,
appUpgradeHandler.currentVersion.toString(),
),
)
appUpgradeHandler.run()
}
appUpgradeHandler.copySubfont(false)
}

/**
* Handle starting the app including auto sign in and navigating to the right starting page
*/
@VisibleForTesting
internal suspend fun handleAppStart() {
val signInAutomatically = preferences.data.first().signInAutomatically
val currentUser = serverRepository.current.value
if (signInAutomatically && currentUser != null && !currentUser.user.isProtected) {
// Hot reload
Timber.v("Hot reload restoring state")
setupNavigationManager.navigateTo(
SetupDestination.AppContent(currentUser),
)
} else {
val restoredSession =
if (signInAutomatically) {
Timber.v("Sign in automatically")
serverRepository.restoreLastSession()
} else {
serverRepository.getMostRecentServer()
}
Timber.d("Restore last session result=%s", restoredSession)
setupNavigationManager.navigateTo(restoredSession.destination)
}
}
}

private val Destination?.isPlayback: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import androidx.compose.runtime.ExperimentalComposeRuntimeApi
import androidx.hilt.work.HiltWorkerFactory
import androidx.work.Configuration
import dagger.hilt.android.HiltAndroidApp
import okhttp3.OkHttp
import org.acra.ACRA
import org.acra.ReportField
import org.acra.config.dialog
Expand Down Expand Up @@ -72,7 +71,6 @@ class WholphinApplication :
// .build(),
// )
}
OkHttp.initialize(this)
initAcra {
buildConfigClass = BuildConfig::class.java
reportFormat = StringFormat.JSON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.savedstate.SavedStateRegistry
import androidx.savedstate.SavedStateRegistryController
import androidx.savedstate.SavedStateRegistryOwner
import androidx.savedstate.setViewTreeSavedStateRegistryOwner
import com.github.damontecres.wholphin.data.RestoredSession
import com.github.damontecres.wholphin.data.ServerRepository
import com.github.damontecres.wholphin.preferences.AppPreferences
import com.github.damontecres.wholphin.services.ScreensaverService
Expand All @@ -33,9 +34,7 @@ import com.github.damontecres.wholphin.ui.theme.WholphinTheme
import com.github.damontecres.wholphin.ui.util.ProvideLocalClock
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.first
import okhttp3.OkHttpClient
import org.jellyfin.sdk.model.serializer.toUUIDOrNull
import timber.log.Timber
import javax.inject.Inject
import kotlin.time.Duration.Companion.milliseconds
Expand Down Expand Up @@ -75,8 +74,10 @@ class WholphinDreamService :
lifecycleRegistry.currentState = Lifecycle.State.CREATED
lifecycleScope.launchDefault {
if (serverRepository.current.value == null) {
val prefs = preferencesDataStore.data.first()
serverRepository.restoreSession(prefs.currentServerId.toUUIDOrNull(), prefs.currentUserId.toUUIDOrNull())
val result = serverRepository.restoreLastSession()
if (result !is RestoredSession.Success) {
Timber.w("Could not restore user session")
}
}
}
}
Expand Down
Loading
Loading