mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix: Crash when trying to edit an entry
Fixes GH-65
This commit is contained in:
parent
2341e21148
commit
efc2a23cb6
2 changed files with 12 additions and 3 deletions
|
@ -197,7 +197,7 @@ class CustomMangaManager(val context: Context) {
|
|||
author: String? = null,
|
||||
artist: String? = null,
|
||||
description: String? = null,
|
||||
genre: String = "",
|
||||
genre: String? = null,
|
||||
status: Int? = null,
|
||||
): ComicInfoYokai {
|
||||
return ComicInfoYokai(
|
||||
|
@ -214,7 +214,7 @@ class CustomMangaManager(val context: Context) {
|
|||
coverArtist = null,
|
||||
translator = null,
|
||||
summary = description?.let { ComicInfo.Summary(it) },
|
||||
genre = genre.takeIf { it.isNotEmpty() }?.let { ComicInfo.Genre(it) },
|
||||
genre = genre?.let { ComicInfo.Genre(it) },
|
||||
tags = null,
|
||||
web = null,
|
||||
publishingStatus = status.takeUnless { it == 0 }?.let {
|
||||
|
@ -235,5 +235,6 @@ class CustomMangaManager(val context: Context) {
|
|||
private fun mangaFromComicInfoObject(id: Long, comicInfo: ComicInfo) = MangaImpl().apply {
|
||||
this.id = id
|
||||
this.copyFromComicInfo(comicInfo)
|
||||
this.title = comicInfo.series?.value ?: ""
|
||||
}
|
||||
}
|
||||
|
|
|
@ -712,7 +712,15 @@ class MangaDetailsPresenter(
|
|||
fun confirmDeletion() {
|
||||
launchIO {
|
||||
coverCache.deleteFromCache(manga)
|
||||
customMangaManager.saveMangaInfo(CustomMangaManager.ComicList.ComicInfoYokai.create(manga.id!!))
|
||||
customMangaManager.saveMangaInfo(CustomMangaManager.ComicList.ComicInfoYokai.create(
|
||||
id = manga.id!!,
|
||||
title = null,
|
||||
author = null,
|
||||
artist = null,
|
||||
description = null,
|
||||
genre = null as String?,
|
||||
status = null,
|
||||
))
|
||||
downloadManager.deleteManga(manga, source)
|
||||
asyncUpdateMangaAndChapters(true)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue