Propagate errors from writeComicInfo to callers
This commit is contained in:
1 parent
36c3fd6f5d
commit
85b03d9d8a
2 files changed
+13
-13
No files matched your search
@@ -352,19 +352,15 @@ class SpiderDen(val info: GalleryInfo) {
|
||||
suspend fun writeComicInfo(fetchMetadata: Boolean = true) {
|
||||
downloadDir?.run {
|
||||
resolve(COMIC_INFO_FILE).also {
|
||||
runCatching {
|
||||
if (info !is GalleryDetail && fetchMetadata) {
|
||||
EhEngine.fillGalleryListByApi(listOf(info))
|
||||
if (info !is GalleryDetail && fetchMetadata) {
|
||||
EhEngine.fillGalleryListByApi(listOf(info))
|
||||
}
|
||||
info.getComicInfo().apply {
|
||||
write(it)
|
||||
DownloadManager.getDownloadInfo(gid)?.let { downloadInfo ->
|
||||
downloadInfo.artistInfoList = DownloadArtist.from(gid, penciller.orEmpty())
|
||||
EhDB.putDownloadArtist(gid, downloadInfo.artistInfoList)
|
||||
}
|
||||
info.getComicInfo().apply {
|
||||
write(it)
|
||||
DownloadManager.getDownloadInfo(gid)?.let { downloadInfo ->
|
||||
downloadInfo.artistInfoList = DownloadArtist.from(gid, penciller.orEmpty())
|
||||
EhDB.putDownloadArtist(gid, downloadInfo.artistInfoList)
|
||||
}
|
||||
}
|
||||
}.onFailure {
|
||||
logcat(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,11 @@ class SpiderQueen private constructor(val galleryInfo: GalleryInfo) : CoroutineS
|
||||
}
|
||||
if (!spiderDen.postArchive()) {
|
||||
if (mWorkerScope.isDownloadMode) {
|
||||
spiderDen.writeComicInfo()
|
||||
runCatching {
|
||||
spiderDen.writeComicInfo()
|
||||
}.onFailure {
|
||||
logcat(it)
|
||||
}
|
||||
}
|
||||
runCatching {
|
||||
writeSpiderInfoToLocal()
|
||||
|
||||
Reference in new issue
Block a user