Maintain source info in the database. (#6389)

* Maintain Source Info in database

* Review changes and cleanups

* Review changes 2

* Review Changes 3
This commit is contained in:
AntsyLich
2022-06-14 19:10:40 +06:00
committed by GitHub
parent a01c370d63
commit 9d5b7de1d8
28 changed files with 307 additions and 48 deletions
@@ -1140,7 +1140,9 @@ class MangaController :
private fun downloadChapters(chapters: List<ChapterItem>) {
if (source is SourceManager.StubSource) {
activity?.toast(R.string.loader_not_implemented_error)
activity?.let {
it.toast(it.getString(R.string.source_not_installed, source?.toString().orEmpty()))
}
return
}
@@ -228,11 +228,7 @@ class MangaInfoHeaderAdapter(
*/
private fun setMangaInfo() {
// Update full title TextView.
binding.mangaFullTitle.text = if (manga.title.isBlank()) {
view.context.getString(R.string.unknown)
} else {
manga.title
}
binding.mangaFullTitle.text = manga.title.ifBlank { view.context.getString(R.string.unknown) }
// Update author TextView.
binding.mangaAuthor.text = if (manga.author.isNullOrBlank()) {
@@ -249,6 +245,8 @@ class MangaInfoHeaderAdapter(
}
// If manga source is known update source TextView.
binding.mangaMissingSourceIcon.isVisible = source is SourceManager.StubSource
val mangaSource = source.toString()
with(binding.mangaSource) {
val enabledLanguages = preferences.enabledLanguages().get()