Skip to content

Commit

Permalink
fix: Prevent returning empty strings in Document.getInfo function
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudemirovsky committed Nov 25, 2023
1 parent f910298 commit 1d7da4d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ class GogoAnime : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
// ============================= Utilities ==============================
private fun Document.getInfo(text: String): String? {
val base = selectFirst("p.type:has(span:containsOwn($text))") ?: return null
return base.select("a").eachText().joinToString("").ifBlank { base.ownText() }
return base.select("a").eachText().joinToString("")
.ifBlank { base.ownText() }
.takeUnless(String::isBlank)
}

override fun List<Video>.sort(): List<Video> {
Expand Down

0 comments on commit 1d7da4d

Please sign in to comment.