From e6511061a78b001f718072b58b18d7da8d09052b Mon Sep 17 00:00:00 2001 From: Koitharu Date: Thu, 20 Apr 2023 18:07:20 +0300 Subject: [PATCH] [Grouple] Fix server selecting --- .../koitharu/kotatsu/parsers/site/grouple/GroupleParser.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/GroupleParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/GroupleParser.kt index 81c81b4a2..6b58614f2 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/GroupleParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/grouple/GroupleParser.kt @@ -240,7 +240,7 @@ internal abstract class GroupleParser( val path = parts.last() val servers = parts.dropLast(1).toSet() val cachedServer = cachedPagesServer - if (cachedServer != null && cachedServer in servers && tryHead(concatUrl(cachedServer, path))) { + if (!cachedServer.isNullOrEmpty() && cachedServer in servers && tryHead(concatUrl(cachedServer, path))) { return concatUrl(cachedServer, path) } if (servers.isEmpty()) { @@ -260,7 +260,7 @@ internal abstract class GroupleParser( } catch (e: NoSuchElementException) { servers.random() } - return concatUrl(checkNotNull(server), path) + return concatUrl(checkNotNull(server).ifEmpty { "https://$domain/" }, path) } override suspend fun getTags(): Set {