fix: most recent watch at beginning of list
This commit is contained in:
parent
21b9d51a35
commit
458f4d1ff9
3 changed files with 21 additions and 13 deletions
|
@ -301,10 +301,14 @@ class AnilistQueries {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val set = PrefManager.getCustomVal<Set<Int>>("continue_$type", setOf()).toMutableSet()
|
if (type != "ANIME") {
|
||||||
|
returnArray.addAll(map.values)
|
||||||
|
return returnArray
|
||||||
|
}
|
||||||
|
val set = PrefManager.getVal<Set<String>>(PrefName.ContinuedAnimeSet).toMutableSet()
|
||||||
if (set.isNotEmpty()) {
|
if (set.isNotEmpty()) {
|
||||||
set.reversed().forEach {
|
set.forEach {
|
||||||
if (map.containsKey(it)) returnArray.add(map[it]!!)
|
if (map.containsKey(it.toInt())) returnArray.add(map[it.toInt()]!!)
|
||||||
}
|
}
|
||||||
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)
|
||||||
|
@ -448,11 +452,15 @@ class AnilistQueries {
|
||||||
subMap[m.id] = m
|
subMap[m.id] = m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val set = PrefManager.getCustomVal<Set<Int>>("continue_${type.uppercase()}", setOf())
|
if (type != "Anime") {
|
||||||
.toMutableSet()
|
returnArray.addAll(subMap.values)
|
||||||
|
returnMap["current$type"] = returnArray
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val set = PrefManager.getVal<Set<String>>(PrefName.ContinuedAnimeSet).toMutableSet()
|
||||||
if (set.isNotEmpty()) {
|
if (set.isNotEmpty()) {
|
||||||
set.reversed().forEach {
|
set.forEach {
|
||||||
if (subMap.containsKey(it)) returnArray.add(subMap[it]!!)
|
if (subMap.containsKey(it.toInt())) returnArray.add(subMap[it.toInt()]!!)
|
||||||
}
|
}
|
||||||
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)
|
||||||
|
|
|
@ -1245,10 +1245,10 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
||||||
media.anime!!.selectedEpisode!!
|
media.anime!!.selectedEpisode!!
|
||||||
)
|
)
|
||||||
|
|
||||||
val list = PrefManager.getVal<Set<Int>>(PrefName.ContinuedAnime).toMutableList()
|
val list = PrefManager.getVal<Set<String>>(PrefName.ContinuedAnimeSet).toMutableList()
|
||||||
if (list.contains(media.id)) list.remove(media.id)
|
if (list.contains(media.id.toString())) list.remove(media.id.toString())
|
||||||
list.add(media.id)
|
list.add(media.id.toString())
|
||||||
PrefManager.setVal(PrefName.ContinuedAnime, list.toList())
|
PrefManager.setVal(PrefName.ContinuedAnimeSet, list.toSet())
|
||||||
|
|
||||||
lifecycleScope.launch(Dispatchers.IO) {
|
lifecycleScope.launch(Dispatchers.IO) {
|
||||||
extractor?.onVideoStopped(video)
|
extractor?.onVideoStopped(video)
|
||||||
|
|
|
@ -10,7 +10,7 @@ enum class PrefName(val data: Pref) { //TODO: Split this into multiple files
|
||||||
SharedUserID(Pref(Location.General, Boolean::class, true)),
|
SharedUserID(Pref(Location.General, Boolean::class, true)),
|
||||||
OfflineView(Pref(Location.General, Int::class, 0)),
|
OfflineView(Pref(Location.General, Int::class, 0)),
|
||||||
DownloadManager(Pref(Location.General, Int::class, 0)),
|
DownloadManager(Pref(Location.General, Int::class, 0)),
|
||||||
NSFWExtension(Pref(Location.General, Boolean::class, false)),
|
NSFWExtension(Pref(Location.General, Boolean::class, true)),
|
||||||
SdDl(Pref(Location.General, Boolean::class, false)),
|
SdDl(Pref(Location.General, Boolean::class, false)),
|
||||||
ContinueMedia(Pref(Location.General, Boolean::class, true)),
|
ContinueMedia(Pref(Location.General, Boolean::class, true)),
|
||||||
RecentlyListOnly(Pref(Location.General, Boolean::class, false)),
|
RecentlyListOnly(Pref(Location.General, Boolean::class, false)),
|
||||||
|
@ -98,7 +98,7 @@ 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)),
|
||||||
ContinuedAnime(Pref(Location.Player, List::class, listOf<String>())),
|
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