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.annotation.WorkerThread
|
||||||
import androidx.core.graphics.scale
|
import androidx.core.graphics.scale
|
||||||
import com.lagradost.cloudstream3.mvvm.logError
|
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.Coroutines.ioSafe
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLinkType
|
import com.lagradost.cloudstream3.utils.ExtractorLinkType
|
||||||
|
@ -63,7 +63,7 @@ interface IPreviewGenerator {
|
||||||
companion object {
|
companion object {
|
||||||
fun new(): IPreviewGenerator {
|
fun new(): IPreviewGenerator {
|
||||||
/** because TV has low ram + not show we disable this for now */
|
/** because TV has low ram + not show we disable this for now */
|
||||||
return if (SettingsFragment.isTrueTvSettings()) {
|
return if (isAutoTv()) {
|
||||||
empty()
|
empty()
|
||||||
} else {
|
} else {
|
||||||
PreviewGenerator()
|
PreviewGenerator()
|
||||||
|
|
|
@ -33,6 +33,7 @@ class SettingsFragment : Fragment() {
|
||||||
var beneneCount = 0
|
var beneneCount = 0
|
||||||
|
|
||||||
private var isTv: Boolean = false
|
private var isTv: Boolean = false
|
||||||
|
private var isAutoTv: Boolean = false
|
||||||
private var isTrueTv: Boolean = false
|
private var isTrueTv: Boolean = false
|
||||||
|
|
||||||
fun PreferenceFragmentCompat?.getPref(id: Int): Preference? {
|
fun PreferenceFragmentCompat?.getPref(id: Int): Preference? {
|
||||||
|
@ -121,9 +122,14 @@ class SettingsFragment : Fragment() {
|
||||||
|
|
||||||
fun Context.updateTv() {
|
fun Context.updateTv() {
|
||||||
isTrueTv = isTrueTvSettings()
|
isTrueTv = isTrueTvSettings()
|
||||||
|
isAutoTv = isAutoTv()
|
||||||
isTv = isTvSettings()
|
isTv = isTvSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun isAutoTv(): Boolean {
|
||||||
|
return isAutoTv
|
||||||
|
}
|
||||||
|
|
||||||
fun isTrueTvSettings(): Boolean {
|
fun isTrueTvSettings(): Boolean {
|
||||||
return isTrueTv
|
return isTrueTv
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue