mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Make homepage preferences account specific
This commit is contained in:
parent
462073bd74
commit
5f98b9a139
2 changed files with 5 additions and 5 deletions
|
@ -377,13 +377,13 @@ class HomeFragment : Fragment() {
|
|||
var currentApiName = selectedApiName
|
||||
|
||||
var currentValidApis: MutableList<MainAPI> = mutableListOf()
|
||||
val preSelectedTypes = this.getKey<List<String>>(HOME_PREF_HOMEPAGE)
|
||||
val preSelectedTypes = this.getKey<List<String>>("${DataStoreHelper.currentAccount}/$HOME_PREF_HOMEPAGE")
|
||||
?.mapNotNull { listName -> TvType.values().firstOrNull { it.name == listName } }
|
||||
?.toMutableList()
|
||||
?: mutableListOf(TvType.Movie, TvType.TvSeries)
|
||||
|
||||
binding.cancelBtt.setOnClickListener {
|
||||
dialog.dismissSafe()
|
||||
dialog.dismissSafe()
|
||||
}
|
||||
|
||||
binding.applyBtt.setOnClickListener {
|
||||
|
|
|
@ -171,7 +171,7 @@ class HomeViewModel : ViewModel() {
|
|||
|
||||
if (currentWatchTypes.size <= 0) {
|
||||
setKey(
|
||||
HOME_BOOKMARK_VALUE_LIST,
|
||||
"${DataStoreHelper.currentAccount}/$HOME_BOOKMARK_VALUE_LIST",
|
||||
intArrayOf()
|
||||
)
|
||||
_availableWatchStatusTypes.postValue(setOf<WatchType>() to setOf())
|
||||
|
@ -182,7 +182,7 @@ class HomeViewModel : ViewModel() {
|
|||
val watchPrefNotNull = preferredWatchStatus ?: EnumSet.of(currentWatchTypes.first())
|
||||
//if (currentWatchTypes.any { watchPrefNotNull.contains(it) }) watchPrefNotNull else listOf(currentWatchTypes.first())
|
||||
setKey(
|
||||
HOME_BOOKMARK_VALUE_LIST,
|
||||
"${DataStoreHelper.currentAccount}/$HOME_BOOKMARK_VALUE_LIST",
|
||||
watchPrefNotNull.map { it.internalId }.toIntArray()
|
||||
)
|
||||
_availableWatchStatusTypes.postValue(
|
||||
|
@ -463,7 +463,7 @@ class HomeViewModel : ViewModel() {
|
|||
|
||||
fun loadStoredData() {
|
||||
val list = EnumSet.noneOf(WatchType::class.java)
|
||||
getKey<IntArray>(HOME_BOOKMARK_VALUE_LIST)?.map { WatchType.fromInternalId(it) }?.let {
|
||||
getKey<IntArray>("${DataStoreHelper.currentAccount}/$HOME_BOOKMARK_VALUE_LIST")?.map { WatchType.fromInternalId(it) }?.let {
|
||||
list.addAll(it)
|
||||
}
|
||||
loadStoredData(list)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue