Update the coroutine dependency and fix issues that were causing the crash
This commit is contained in:
parent
f7d991ab54
commit
9d764781c3
@ -281,7 +281,7 @@ dependencies {
|
|||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||||
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
||||||
|
|
||||||
final coroutines_version = '1.3.5'
|
final coroutines_version = '1.3.7'
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-reactive:$coroutines_version"
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-reactive:$coroutines_version"
|
||||||
|
@ -161,7 +161,7 @@ class MangaAllInOnePresenter(
|
|||||||
scope.launch(Dispatchers.IO) {
|
scope.launch(Dispatchers.IO) {
|
||||||
var manga2: Manga? = null
|
var manga2: Manga? = null
|
||||||
if (updateInfo) {
|
if (updateInfo) {
|
||||||
manga2 = db.getManga(manga.url, manga.source).executeAsBlocking()!!
|
manga2 = db.getManga(manga.url, manga.source).executeAsBlocking()
|
||||||
updateChapters()
|
updateChapters()
|
||||||
updateChapterInfo()
|
updateChapterInfo()
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ class MangaAllInOnePresenter(
|
|||||||
val networkManga = try {
|
val networkManga = try {
|
||||||
source.fetchMangaDetails(manga).toBlocking().single()
|
source.fetchMangaDetails(manga).toBlocking().single()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
withContext(Dispatchers.Main) { controller.onFetchMangaError(e) }
|
controller.onFetchMangaError(e)
|
||||||
return@launch
|
return@launch
|
||||||
}
|
}
|
||||||
if (networkManga != null) {
|
if (networkManga != null) {
|
||||||
@ -205,7 +205,7 @@ class MangaAllInOnePresenter(
|
|||||||
try {
|
try {
|
||||||
chapters = source.fetchChapterList(manga).toBlocking().single()
|
chapters = source.fetchChapterList(manga).toBlocking().single()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
withContext(Dispatchers.Main) { controller.onFetchMangaError(e) }
|
controller.onFetchMangaError(e)
|
||||||
return@launch
|
return@launch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -220,13 +220,11 @@ class MangaAllInOnePresenter(
|
|||||||
updateManga(updateInfo = false)
|
updateManga(updateInfo = false)
|
||||||
controller.onFetchMangaDone()
|
controller.onFetchMangaDone()
|
||||||
}
|
}
|
||||||
} catch (e: java.lang.Exception) {
|
} catch (e: Exception) {
|
||||||
withContext(Dispatchers.Main) {
|
|
||||||
controller.onFetchMangaError(e)
|
controller.onFetchMangaError(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update favorite status of manga, (removes / adds) manga (to / from) library.
|
* Update favorite status of manga, (removes / adds) manga (to / from) library.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user