mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-24 00:51:47 +01:00
Few more tracepot crashes
This commit is contained in:
parent
3ad9d84b5f
commit
fdd4b08a49
@ -6,8 +6,6 @@ class LibraryManga : MangaImpl() {
|
|||||||
|
|
||||||
var category: Int = 0
|
var category: Int = 0
|
||||||
|
|
||||||
fun isBlank() = id == Long.MIN_VALUE
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun createBlank(categoryId: Int): LibraryManga = LibraryManga().apply {
|
fun createBlank(categoryId: Int): LibraryManga = LibraryManga().apply {
|
||||||
title = ""
|
title = ""
|
||||||
|
@ -27,6 +27,8 @@ interface Manga : SManga {
|
|||||||
|
|
||||||
var hide_title: Boolean
|
var hide_title: Boolean
|
||||||
|
|
||||||
|
fun isBlank() = id == Long.MIN_VALUE
|
||||||
|
|
||||||
fun setChapterOrder(order: Int) {
|
fun setChapterOrder(order: Int) {
|
||||||
setFlags(order, SORT_MASK)
|
setFlags(order, SORT_MASK)
|
||||||
setFlags(SORT_LOCAL, SORT_SELF_MASK)
|
setFlags(SORT_LOCAL, SORT_SELF_MASK)
|
||||||
|
@ -289,7 +289,7 @@ class LibraryController(
|
|||||||
if (libraryLayout == 0) return 1
|
if (libraryLayout == 0) return 1
|
||||||
val item = this@LibraryController.adapter.getItem(position)
|
val item = this@LibraryController.adapter.getItem(position)
|
||||||
return if (item is LibraryHeaderItem || item is SearchGlobalItem || (item is LibraryItem && item.manga.isBlank())) {
|
return if (item is LibraryHeaderItem || item is SearchGlobalItem || (item is LibraryItem && item.manga.isBlank())) {
|
||||||
recycler.manager.spanCount
|
recycler?.manager?.spanCount ?: 1
|
||||||
} else {
|
} else {
|
||||||
1
|
1
|
||||||
}
|
}
|
||||||
@ -829,6 +829,7 @@ class LibraryController(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setSelection(manga: Manga, selected: Boolean) {
|
private fun setSelection(manga: Manga, selected: Boolean) {
|
||||||
|
if (manga.isBlank()) return
|
||||||
val currentMode = adapter.mode
|
val currentMode = adapter.mode
|
||||||
if (selected) {
|
if (selected) {
|
||||||
if (selectedMangas.add(manga)) {
|
if (selectedMangas.add(manga)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user