Cleanup
This commit is contained in:
parent
96213900ac
commit
78ffd9d56e
@ -698,27 +698,27 @@ class LibraryPresenter(
|
|||||||
}
|
}
|
||||||
val group = grouping.find { it.first == trackManager.mapTrackingOrder(status, context).toString() }
|
val group = grouping.find { it.first == trackManager.mapTrackingOrder(status, context).toString() }
|
||||||
if (group != null) {
|
if (group != null) {
|
||||||
map[group.second]?.plusAssign(libraryItem) ?: map.put(group.second, mutableListOf(libraryItem))
|
map.getOrPut(group.second) { mutableListOf() } += libraryItem
|
||||||
} else {
|
} else {
|
||||||
map[7]?.plusAssign(libraryItem) ?: map.put(7, mutableListOf(libraryItem))
|
map.getOrPut(7) { mutableListOf() } += libraryItem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LibraryGroup.BY_SOURCE -> {
|
LibraryGroup.BY_SOURCE -> {
|
||||||
val group = grouping.find { it.first.toLongOrNull() == libraryItem.manga.source }
|
val group = grouping.find { it.first.toLongOrNull() == libraryItem.manga.source }
|
||||||
if (group != null) {
|
if (group != null) {
|
||||||
map[group.second]?.plusAssign(libraryItem) ?: map.put(group.second, mutableListOf(libraryItem))
|
map.getOrPut(group.second) { mutableListOf() } += libraryItem
|
||||||
} else {
|
} else {
|
||||||
if (grouping.all { it.second != Int.MAX_VALUE }) grouping += Triple(Int.MAX_VALUE.toString(), Int.MAX_VALUE, context.getString(R.string.unknown))
|
if (grouping.all { it.second != Int.MAX_VALUE }) grouping += Triple(Int.MAX_VALUE.toString(), Int.MAX_VALUE, context.getString(R.string.unknown))
|
||||||
map[Int.MAX_VALUE]?.plusAssign(libraryItem) ?: map.put(Int.MAX_VALUE, mutableListOf(libraryItem))
|
map.getOrPut(Int.MAX_VALUE) { mutableListOf() } += libraryItem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
val group = grouping.find { it.second == libraryItem.manga.status }
|
val group = grouping.find { it.second == libraryItem.manga.status }
|
||||||
if (group != null) {
|
if (group != null) {
|
||||||
map[group.second]?.plusAssign(libraryItem) ?: map.put(group.second, mutableListOf(libraryItem))
|
map.getOrPut(group.second) { mutableListOf() } += libraryItem
|
||||||
} else {
|
} else {
|
||||||
if (grouping.all { it.second != Int.MAX_VALUE }) grouping += Triple(Int.MAX_VALUE.toString(), Int.MAX_VALUE, context.getString(R.string.unknown))
|
if (grouping.all { it.second != Int.MAX_VALUE }) grouping += Triple(Int.MAX_VALUE.toString(), Int.MAX_VALUE, context.getString(R.string.unknown))
|
||||||
map[Int.MAX_VALUE]?.plusAssign(libraryItem) ?: map.put(Int.MAX_VALUE, mutableListOf(libraryItem))
|
map.getOrPut(Int.MAX_VALUE) { mutableListOf() } += libraryItem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -730,7 +730,8 @@ class LibraryPresenter(
|
|||||||
LibraryGroup.BY_TRACK_STATUS, LibraryGroup.BY_STATUS -> grouping.filter { it.second in map.keys }
|
LibraryGroup.BY_TRACK_STATUS, LibraryGroup.BY_STATUS -> grouping.filter { it.second in map.keys }
|
||||||
else -> grouping
|
else -> grouping
|
||||||
}
|
}
|
||||||
).map {
|
)
|
||||||
|
.map {
|
||||||
val category = Category.create(it.third)
|
val category = Category.create(it.third)
|
||||||
category.id = it.second
|
category.id = it.second
|
||||||
category
|
category
|
||||||
|
@ -11,7 +11,7 @@ import com.afollestad.materialdialogs.list.listItemsSingleChoice
|
|||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.databinding.EhActivityInterceptBinding
|
import eu.kanade.tachiyomi.databinding.EhActivityInterceptBinding
|
||||||
import eu.kanade.tachiyomi.source.online.UrlImportableSource
|
import eu.kanade.tachiyomi.source.online.UrlImportableSource
|
||||||
import eu.kanade.tachiyomi.ui.base.activity.BaseActivity
|
import eu.kanade.tachiyomi.ui.base.activity.BaseViewBindingActivity
|
||||||
import eu.kanade.tachiyomi.ui.main.MainActivity
|
import eu.kanade.tachiyomi.ui.main.MainActivity
|
||||||
import eu.kanade.tachiyomi.ui.manga.MangaController
|
import eu.kanade.tachiyomi.ui.manga.MangaController
|
||||||
import exh.GalleryAddEvent
|
import exh.GalleryAddEvent
|
||||||
@ -23,7 +23,7 @@ import kotlinx.coroutines.flow.launchIn
|
|||||||
import kotlinx.coroutines.flow.onEach
|
import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
class InterceptActivity : BaseActivity<EhActivityInterceptBinding>() {
|
class InterceptActivity : BaseViewBindingActivity<EhActivityInterceptBinding>() {
|
||||||
private var statusJob: Job? = null
|
private var statusJob: Job? = null
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user