Only disable PreviewGenerator if it is really a TV

This commit is contained in:
Luna712 2023-10-20 12:05:33 -06:00
parent 3cb2196e62
commit 74a2d70625
2 changed files with 8 additions and 2 deletions

View file

@ -9,7 +9,7 @@ import android.util.Log
import androidx.annotation.WorkerThread
import androidx.core.graphics.scale
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.ui.settings.SettingsFragment
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isAutoTv
import com.lagradost.cloudstream3.utils.Coroutines.ioSafe
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.ExtractorLinkType
@ -63,7 +63,7 @@ interface IPreviewGenerator {
companion object {
fun new(): IPreviewGenerator {
/** because TV has low ram + not show we disable this for now */
return if (SettingsFragment.isTrueTvSettings()) {
return if (isAutoTv()) {
empty()
} else {
PreviewGenerator()

View file

@ -33,6 +33,7 @@ class SettingsFragment : Fragment() {
var beneneCount = 0
private var isTv: Boolean = false
private var isAutoTv: Boolean = false
private var isTrueTv: Boolean = false
fun PreferenceFragmentCompat?.getPref(id: Int): Preference? {
@ -121,9 +122,14 @@ class SettingsFragment : Fragment() {
fun Context.updateTv() {
isTrueTv = isTrueTvSettings()
isAutoTv = isAutoTv()
isTv = isTvSettings()
}
fun isAutoTv(): Boolean {
return isAutoTv
}
fun isTrueTvSettings(): Boolean {
return isTrueTv
}