mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Only disable PreviewGenerator if it is really a TV
This commit is contained in:
parent
3cb2196e62
commit
74a2d70625
2 changed files with 8 additions and 2 deletions
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue