MangaReader.to: simplify parseAuthor code (#13341)
This commit is contained in:
parent
6f4651023b
commit
659ad4b264
|
@ -133,12 +133,10 @@ open class MangaReader(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val nodes = childNodes()
|
|
||||||
val authorList = ArrayList<String>(count)
|
val authorList = ArrayList<String>(count)
|
||||||
val artistList = ArrayList<String>(count)
|
val artistList = ArrayList<String>(count)
|
||||||
for ((index, author) in authors.withIndex()) {
|
for ((index, author) in authors.withIndex()) {
|
||||||
val nodeIndex = nodes.indexOf(author)
|
val textNode = author.nextSibling() as? TextNode
|
||||||
val textNode = nodes.getOrNull(nodeIndex + 1) as? TextNode
|
|
||||||
val list = if (textNode != null && "(Art)" in textNode.wholeText) artistList else authorList
|
val list = if (textNode != null && "(Art)" in textNode.wholeText) artistList else authorList
|
||||||
list.add(text[index])
|
list.add(text[index])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue