Fix DeleteSortTag not re-indexing tags

This commit is contained in:
Jobobby04 2022-11-02 21:16:11 -04:00
parent 8facc5346f
commit 33fc5fcc0e

View File

@ -1,7 +1,6 @@
package eu.kanade.domain.manga.interactor
import eu.kanade.domain.library.service.LibraryPreferences
import eu.kanade.tachiyomi.util.preference.minusAssign
class DeleteSortTag(
private val preferences: LibraryPreferences,
@ -9,8 +8,10 @@ class DeleteSortTag(
) {
fun await(tag: String) {
getSortTag.await().withIndex().find { it.value == tag }?.let {
preferences.sortTagsForLibrary() -= CreateSortTag.encodeTag(it.index, it.value)
}
preferences.sortTagsForLibrary().set(
(getSortTag.await() - tag).mapIndexed { index, s ->
CreateSortTag.encodeTag(index, s)
}.toSet(),
)
}
}