handle when title is changing properly

This commit is contained in:
Aria Moradi
2021-09-18 02:10:35 +04:30
parent 1f3dc682e2
commit 5fc28ef711
5 changed files with 77 additions and 23 deletions

View File

@@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.source
// import com.github.junrar.Archive
// import java.util.zip.ZipFile
import com.google.gson.JsonParser
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
@@ -170,7 +169,7 @@ class LocalSource(override val baseUrl: String = "") : HttpSource() {
url = mangaDir.name
// Try to find the cover
val cover = File("${applicationDirs.localMangaRoot}/$title/cover.jpg")
val cover = File("${applicationDirs.localMangaRoot}/$url/cover.jpg")
if (cover.exists()) {
thumbnail_url = "http://${cover.absolutePath}"
}
@@ -209,7 +208,6 @@ class LocalSource(override val baseUrl: String = "") : HttpSource() {
?.apply {
val obj = json.decodeFromStream<JsonObject>(inputStream())
manga.title = obj["title"]?.jsonPrimitive?.contentOrNull ?: manga.title
manga.author = obj["author"]?.jsonPrimitive?.contentOrNull ?: manga.author
manga.artist = obj["artist"]?.jsonPrimitive?.contentOrNull ?: manga.artist