mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix: Language not being used
This commit is contained in:
parent
6bf37b36c3
commit
0846e48d6a
2 changed files with 4 additions and 3 deletions
|
@ -8,7 +8,7 @@ import nl.adaptivity.xmlutil.serialization.XmlValue
|
||||||
|
|
||||||
const val COMIC_INFO_FILE = "ComicInfo.xml"
|
const val COMIC_INFO_FILE = "ComicInfo.xml"
|
||||||
|
|
||||||
fun SManga.toComicInfo() = ComicInfo(
|
fun SManga.toComicInfo(lang: String? = null) = ComicInfo(
|
||||||
title = null,
|
title = null,
|
||||||
series = ComicInfo.Series(title),
|
series = ComicInfo.Series(title),
|
||||||
number = null,
|
number = null,
|
||||||
|
@ -28,7 +28,7 @@ fun SManga.toComicInfo() = ComicInfo(
|
||||||
),
|
),
|
||||||
categories = null,
|
categories = null,
|
||||||
source = null,
|
source = null,
|
||||||
language = null,
|
language = lang?.let { ComicInfo.LanguageJ2K(it) },
|
||||||
)
|
)
|
||||||
|
|
||||||
fun SManga.copyFromComicInfo(comicInfo: ComicInfo) {
|
fun SManga.copyFromComicInfo(comicInfo: ComicInfo) {
|
||||||
|
|
|
@ -220,6 +220,7 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
|
||||||
xml.decodeFromReader<ComicInfo>(it)
|
xml.decodeFromReader<ComicInfo>(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
comicInfo.language?.let { langMap[manga.url] = it.value }
|
||||||
manga.copyFromComicInfo(comicInfo)
|
manga.copyFromComicInfo(comicInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +244,7 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
|
||||||
|
|
||||||
lang?.let { langMap[manga.url] = it }
|
lang?.let { langMap[manga.url] = it }
|
||||||
val file = directory.createFile(COMIC_INFO_FILE)!!
|
val file = directory.createFile(COMIC_INFO_FILE)!!
|
||||||
file.writeText(xml.encodeToString(ComicInfo.serializer(), manga.toComicInfo()))
|
file.writeText(xml.encodeToString(ComicInfo.serializer(), manga.toComicInfo(lang)))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue