Skip to content

How to get book title and book author for CBZ file? #660

Answered by kuro-mujou
kuro-mujou asked this question in Q&A
Discussion options

You must be logged in to vote

okay i change my code to read that xml file and it work!

suspend fun readComicInfoXml(publication: Publication?) {
        val comicInfoHref = "ComicInfo.xml"
        val url = Url(comicInfoHref)

        val resource = publication?.container?.get(url!!)
        if (resource == null) {
            Log.w("Publication", "ComicInfo.xml not found in container")
            return
        }

        val result = resource.read()
        result.onSuccess { byteArray ->
            val parserFactory = XmlPullParserFactory.newInstance()
            parserFactory.isNamespaceAware = true
            val parser = parserFactory.newPullParser()

            parser.setInput(ByteArrayInputStream(byteArra…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kuro-mujou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant