mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix(LocalSource): Url is not initialized
This commit is contained in:
parent
0846e48d6a
commit
683c6a4a21
2 changed files with 8 additions and 3 deletions
|
@ -198,11 +198,17 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
|
||||||
val legacyJsonFile = localMangaFiles.firstOrNull { it.extension.orEmpty().equals("json", true) }
|
val legacyJsonFile = localMangaFiles.firstOrNull { it.extension.orEmpty().equals("json", true) }
|
||||||
|
|
||||||
if (comicInfoFile != null)
|
if (comicInfoFile != null)
|
||||||
return SManga.create().apply { setMangaDetailsFromComicInfoFile(comicInfoFile.openInputStream(), this) }
|
return SManga.create().apply {
|
||||||
|
url = manga.url
|
||||||
|
setMangaDetailsFromComicInfoFile(comicInfoFile.openInputStream(), this)
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Remove after awhile
|
// TODO: Remove after awhile
|
||||||
if (legacyJsonFile != null) {
|
if (legacyJsonFile != null) {
|
||||||
val rt = SManga.create().apply { setMangaDetailsFromLegacyJsonFile(legacyJsonFile.openInputStream(), this) }
|
val rt = SManga.create().apply {
|
||||||
|
url = manga.url
|
||||||
|
setMangaDetailsFromLegacyJsonFile(legacyJsonFile.openInputStream(), this)
|
||||||
|
}
|
||||||
val comicInfo = rt.toComicInfo()
|
val comicInfo = rt.toComicInfo()
|
||||||
localMangaDir.createFile(COMIC_INFO_FILE)
|
localMangaDir.createFile(COMIC_INFO_FILE)
|
||||||
?.writeText(xml.encodeToString(ComicInfo.serializer(), comicInfo)) { legacyJsonFile.delete() }
|
?.writeText(xml.encodeToString(ComicInfo.serializer(), comicInfo)) { legacyJsonFile.delete() }
|
||||||
|
|
|
@ -783,7 +783,6 @@ class MangaDetailsPresenter(
|
||||||
db.updateViewerFlags(manga).executeAsBlocking()
|
db.updateViewerFlags(manga).executeAsBlocking()
|
||||||
}
|
}
|
||||||
manga.status = status ?: SManga.UNKNOWN
|
manga.status = status ?: SManga.UNKNOWN
|
||||||
// TODO: Use ComicInfo
|
|
||||||
LocalSource(downloadManager.context).updateMangaInfo(manga, lang)
|
LocalSource(downloadManager.context).updateMangaInfo(manga, lang)
|
||||||
db.updateMangaInfo(manga).executeAsBlocking()
|
db.updateMangaInfo(manga).executeAsBlocking()
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue