From dad9dcd742fa14927b752f45211796bc334239da Mon Sep 17 00:00:00 2001 From: Taumer Date: Tue, 7 Jun 2016 21:04:50 +0300 Subject: [PATCH] Improve getAbsolutUrl method (#336) Also fix Mangachan most popular pages --- .../java/eu/kanade/tachiyomi/data/source/online/OnlineSource.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/OnlineSource.kt b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/OnlineSource.kt index fb1325a2c..f482b1121 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/OnlineSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/OnlineSource.kt @@ -415,6 +415,7 @@ abstract class OnlineSource(context: Context) : Source { * href="http://example.com/foo" url="http://example.com" -> http://example.com/foo * href="/mypath" url="http://example.com/foo" -> http://example.com/mypath * href="bar" url="http://example.com/foo" -> http://example.com/bar + * href="?bar" url="http://example.com/foo" -> http://example.com/foo?bar * href="bar" url="http://example.com/foo/" -> http://example.com/foo/bar * * @param href the href attribute from the html. @@ -424,6 +425,7 @@ abstract class OnlineSource(context: Context) : Source { href.startsWith("http://") || href.startsWith("https://") -> href href.startsWith("/") -> url.newBuilder().encodedPath("/").fragment(null).query(null) .toString() + href.substring(1) + href.startsWith("?") -> url.toString().substringBeforeLast('?') + "$href" else -> url.toString().substringBeforeLast('/') + "/$href" }