fix: home list sorting
This commit is contained in:
parent
7ad586c994
commit
ab14c4815f
3 changed files with 15 additions and 16 deletions
|
@ -352,10 +352,10 @@ class AnilistQueries {
|
||||||
returnArray.addAll(map.values)
|
returnArray.addAll(map.values)
|
||||||
return returnArray
|
return returnArray
|
||||||
}
|
}
|
||||||
val set = PrefManager.getVal<Set<String>>(PrefName.ContinuedAnimeSet).toMutableSet()
|
val list = PrefManager.getNullableCustomVal("continueAnimeList", listOf<Int>(), List::class.java) as List<Int>
|
||||||
if (set.isNotEmpty()) {
|
if (list.isNotEmpty()) {
|
||||||
set.forEach {
|
list.reversed().forEach {
|
||||||
if (map.containsKey(it.toInt())) returnArray.add(map[it.toInt()]!!)
|
if (map.containsKey(it)) returnArray.add(map[it]!!)
|
||||||
}
|
}
|
||||||
for (i in map) {
|
for (i in map) {
|
||||||
if (i.value !in returnArray) returnArray.add(i.value)
|
if (i.value !in returnArray) returnArray.add(i.value)
|
||||||
|
@ -504,10 +504,10 @@ class AnilistQueries {
|
||||||
returnMap["current$type"] = returnArray
|
returnMap["current$type"] = returnArray
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val set = PrefManager.getVal<Set<String>>(PrefName.ContinuedAnimeSet).toMutableSet()
|
val list = PrefManager.getNullableCustomVal("continueAnimeList", listOf<Int>(), List::class.java) as List<Int>
|
||||||
if (set.isNotEmpty()) {
|
if (list.isNotEmpty()) {
|
||||||
set.forEach {
|
list.reversed().forEach {
|
||||||
if (subMap.containsKey(it.toInt())) returnArray.add(subMap[it.toInt()]!!)
|
if (subMap.containsKey(it)) returnArray.add(subMap[it]!!)
|
||||||
}
|
}
|
||||||
for (i in subMap) {
|
for (i in subMap) {
|
||||||
if (i.value !in returnArray) returnArray.add(i.value)
|
if (i.value !in returnArray) returnArray.add(i.value)
|
||||||
|
@ -529,9 +529,9 @@ class AnilistQueries {
|
||||||
subMap[m.id] = m
|
subMap[m.id] = m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val set = PrefManager.getCustomVal<Set<Int>>("continue_$type", setOf()).toMutableSet()
|
val list = PrefManager.getNullableCustomVal("continueAnimeList", listOf<Int>(), List::class.java) as List<Int>
|
||||||
if (set.isNotEmpty()) {
|
if (list.isNotEmpty()) {
|
||||||
set.reversed().forEach {
|
list.reversed().forEach {
|
||||||
if (subMap.containsKey(it)) returnArray.add(subMap[it]!!)
|
if (subMap.containsKey(it)) returnArray.add(subMap[it]!!)
|
||||||
}
|
}
|
||||||
for (i in subMap) {
|
for (i in subMap) {
|
||||||
|
|
|
@ -1245,10 +1245,10 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
||||||
media.anime!!.selectedEpisode!!
|
media.anime!!.selectedEpisode!!
|
||||||
)
|
)
|
||||||
|
|
||||||
val list = PrefManager.getVal<Set<String>>(PrefName.ContinuedAnimeSet).toMutableList()
|
val list = (PrefManager.getNullableCustomVal("continueAnimeList", listOf<Int>(), List::class.java) as List<Int>).toMutableList()
|
||||||
if (list.contains(media.id.toString())) list.remove(media.id.toString())
|
if (list.contains(media.id)) list.remove(media.id)
|
||||||
list.add(media.id.toString())
|
list.add(media.id)
|
||||||
PrefManager.setVal(PrefName.ContinuedAnimeSet, list.toSet())
|
PrefManager.setCustomVal("continueAnimeList", list)
|
||||||
|
|
||||||
lifecycleScope.launch(Dispatchers.IO) {
|
lifecycleScope.launch(Dispatchers.IO) {
|
||||||
extractor?.onVideoStopped(video)
|
extractor?.onVideoStopped(video)
|
||||||
|
|
|
@ -100,7 +100,6 @@ enum class PrefName(val data: Pref) { //TODO: Split this into multiple files
|
||||||
UseInternalCast(Pref(Location.Player, Boolean::class, false)),
|
UseInternalCast(Pref(Location.Player, Boolean::class, false)),
|
||||||
Pip(Pref(Location.Player, Boolean::class, true)),
|
Pip(Pref(Location.Player, Boolean::class, true)),
|
||||||
RotationPlayer(Pref(Location.Player, Boolean::class, true)),
|
RotationPlayer(Pref(Location.Player, Boolean::class, true)),
|
||||||
ContinuedAnimeSet(Pref(Location.Player, Set::class, setOf<String>())),
|
|
||||||
|
|
||||||
//Reader
|
//Reader
|
||||||
ShowSource(Pref(Location.Reader, Boolean::class, true)),
|
ShowSource(Pref(Location.Reader, Boolean::class, true)),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue