fix: logs and try/catch (#6092)
exception catching while building filter list (#6074) error logs whiloe loading filter values (#6047)
This commit is contained in:
parent
32cf064635
commit
1ac4721780
@ -1,3 +1,11 @@
|
|||||||
|
## 1.2.22
|
||||||
|
|
||||||
|
Minimum Komga version required: `0.75.0`
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add error logs and better catch exceptions
|
||||||
|
|
||||||
## 1.2.21
|
## 1.2.21
|
||||||
|
|
||||||
Minimum Komga version required: `0.75.0`
|
Minimum Komga version required: `0.75.0`
|
||||||
|
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'Komga'
|
extName = 'Komga'
|
||||||
pkgNameSuffix = 'all.komga'
|
pkgNameSuffix = 'all.komga'
|
||||||
extClass = '.KomgaFactory'
|
extClass = '.KomgaFactory'
|
||||||
extVersionCode = 21
|
extVersionCode = 22
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import android.content.SharedPreferences
|
|||||||
import android.support.v7.preference.EditTextPreference
|
import android.support.v7.preference.EditTextPreference
|
||||||
import android.support.v7.preference.PreferenceScreen
|
import android.support.v7.preference.PreferenceScreen
|
||||||
import android.text.InputType
|
import android.text.InputType
|
||||||
|
import android.util.Log
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import com.github.salomonbrys.kotson.fromJson
|
import com.github.salomonbrys.kotson.fromJson
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
@ -302,8 +303,9 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
|
|||||||
override fun toString() = name
|
override fun toString() = name
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getFilterList(): FilterList =
|
override fun getFilterList(): FilterList {
|
||||||
FilterList(
|
val filters = try {
|
||||||
|
mutableListOf<Filter<*>>(
|
||||||
UnreadOnly(),
|
UnreadOnly(),
|
||||||
TypeSelect(),
|
TypeSelect(),
|
||||||
CollectionSelect(listOf(CollectionFilterEntry("None")) + collections.map { CollectionFilterEntry(it.name, it.id) }),
|
CollectionSelect(listOf(CollectionFilterEntry("None")) + collections.map { CollectionFilterEntry(it.name, it.id) }),
|
||||||
@ -311,10 +313,18 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
|
|||||||
StatusGroup(listOf("Ongoing", "Ended", "Abandoned", "Hiatus").map { StatusFilter(it) }),
|
StatusGroup(listOf("Ongoing", "Ended", "Abandoned", "Hiatus").map { StatusFilter(it) }),
|
||||||
GenreGroup(genres.map { GenreFilter(it) }),
|
GenreGroup(genres.map { GenreFilter(it) }),
|
||||||
TagGroup(tags.map { TagFilter(it) }),
|
TagGroup(tags.map { TagFilter(it) }),
|
||||||
PublisherGroup(publishers.map { PublisherFilter(it) }),
|
PublisherGroup(publishers.map { PublisherFilter(it) })
|
||||||
*authors.map { (role, authors) -> AuthorGroup(role, authors.map { AuthorFilter(it) }) }.toTypedArray(),
|
).also {
|
||||||
SeriesSort()
|
it.addAll(authors.map { (role, authors) -> AuthorGroup(role, authors.map { AuthorFilter(it) }) })
|
||||||
)
|
it.add(SeriesSort())
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(LOG_TAG, "error while creating filter list", e)
|
||||||
|
emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
return FilterList(filters)
|
||||||
|
}
|
||||||
|
|
||||||
private var libraries = emptyList<LibraryDto>()
|
private var libraries = emptyList<LibraryDto>()
|
||||||
private var collections = emptyList<CollectionDto>()
|
private var collections = emptyList<CollectionDto>()
|
||||||
@ -431,7 +441,9 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
|
|||||||
emptyList()
|
emptyList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{}
|
{ tr ->
|
||||||
|
Log.e(LOG_TAG, "error while loading libraries for filters", tr)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
Single.fromCallable {
|
Single.fromCallable {
|
||||||
@ -447,7 +459,9 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
|
|||||||
emptyList()
|
emptyList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{}
|
{ tr ->
|
||||||
|
Log.e(LOG_TAG, "error while loading collections for filters", tr)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
Single.fromCallable {
|
Single.fromCallable {
|
||||||
@ -463,7 +477,9 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
|
|||||||
emptySet()
|
emptySet()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{}
|
{ tr ->
|
||||||
|
Log.e(LOG_TAG, "error while loading genres for filters", tr)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
Single.fromCallable {
|
Single.fromCallable {
|
||||||
@ -479,7 +495,9 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
|
|||||||
emptySet()
|
emptySet()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{}
|
{ tr ->
|
||||||
|
Log.e(LOG_TAG, "error while loading tags for filters", tr)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
Single.fromCallable {
|
Single.fromCallable {
|
||||||
@ -495,7 +513,9 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
|
|||||||
emptySet()
|
emptySet()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{}
|
{ tr ->
|
||||||
|
Log.e(LOG_TAG, "error while loading publishers for filters", tr)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
Single.fromCallable {
|
Single.fromCallable {
|
||||||
@ -512,7 +532,9 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
|
|||||||
emptyMap()
|
emptyMap()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{}
|
{ tr ->
|
||||||
|
Log.e(LOG_TAG, "error while loading authors for filters", tr)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,5 +550,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
|
|||||||
|
|
||||||
private const val TYPE_SERIES = "Series"
|
private const val TYPE_SERIES = "Series"
|
||||||
private const val TYPE_READLISTS = "Read lists"
|
private const val TYPE_READLISTS = "Read lists"
|
||||||
|
|
||||||
|
private const val LOG_TAG = "extension.all.komga"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user