mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Fix crash when OS screensaver started before opening Wholphin (#1285)
## Description If the Wholphin OS screensaver starts before Wholphin (the app) is opened, a default image loader is used. Then when Wholphin is opened, it will crash when trying to set the app's image loader. This PR adds configuring the image loader to the screensaver as well. It is safe to do this multiple times. It's only an error to try to replace the default image loader. ### Related issues None ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
36b7390c4e
commit
d373b32da5
3 changed files with 36 additions and 9 deletions
|
|
@ -28,7 +28,6 @@ import androidx.lifecycle.viewModelScope
|
|||
import androidx.navigation3.runtime.NavBackStack
|
||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||
import com.github.damontecres.wholphin.data.ServerRepository
|
||||
import com.github.damontecres.wholphin.preferences.AppPreference
|
||||
import com.github.damontecres.wholphin.preferences.AppPreferences
|
||||
import com.github.damontecres.wholphin.preferences.PlayerBackend
|
||||
import com.github.damontecres.wholphin.services.AppUpgradeHandler
|
||||
|
|
@ -220,14 +219,7 @@ class MainActivity : AppCompatActivity() {
|
|||
signInAuto = appPreferences.signInAutomatically
|
||||
}
|
||||
CoilConfig(
|
||||
diskCacheSizeBytes =
|
||||
appPreferences.advancedPreferences.imageDiskCacheSizeBytes.let {
|
||||
if (it < AppPreference.ImageDiskCacheSize.min * AppPreference.MEGA_BIT) {
|
||||
AppPreference.ImageDiskCacheSize.defaultValue * AppPreference.MEGA_BIT
|
||||
} else {
|
||||
it
|
||||
}
|
||||
},
|
||||
prefs = appPreferences,
|
||||
okHttpClient = okHttpClient,
|
||||
debugLogging = false,
|
||||
enableCache = true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue