From b19c3b30c8219387e2a2cde7d741d80aaece0b6c Mon Sep 17 00:00:00 2001 From: Taumer Date: Mon, 10 Sep 2018 14:05:26 +0300 Subject: [PATCH] Fix pages with site static resources on readmanga/mintmanga (#487) Fix pages with site static resources on readmanga/mintmanga --- src/ru/mintmanga/build.gradle | 4 ++-- .../kanade/tachiyomi/extension/ru/mintmanga/Mintmanga.kt | 7 ++++++- src/ru/readmanga/build.gradle | 4 ++-- .../kanade/tachiyomi/extension/ru/readmanga/Readmanga.kt | 7 ++++++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/ru/mintmanga/build.gradle b/src/ru/mintmanga/build.gradle index 01adf4149..e8bccfdd4 100644 --- a/src/ru/mintmanga/build.gradle +++ b/src/ru/mintmanga/build.gradle @@ -5,8 +5,8 @@ ext { appName = 'Tachiyomi: Mintmanga' pkgNameSuffix = 'ru.mintmanga' extClass = '.Mintmanga' - extVersionCode = 6 - extVersionSuffix = 6 + extVersionCode = 7 + extVersionSuffix = 7 libVersion = '1.2' } diff --git a/src/ru/mintmanga/src/eu/kanade/tachiyomi/extension/ru/mintmanga/Mintmanga.kt b/src/ru/mintmanga/src/eu/kanade/tachiyomi/extension/ru/mintmanga/Mintmanga.kt index fa202d7ee..7d64a2544 100644 --- a/src/ru/mintmanga/src/eu/kanade/tachiyomi/extension/ru/mintmanga/Mintmanga.kt +++ b/src/ru/mintmanga/src/eu/kanade/tachiyomi/extension/ru/mintmanga/Mintmanga.kt @@ -151,7 +151,12 @@ class Mintmanga : ParsedHttpSource() { var i = 0 while (m.find()) { val urlParts = m.group().replace("[\"\']+".toRegex(), "").split(',') - pages.add(Page(i++, "", urlParts[1] + urlParts[0] + urlParts[2])) + val url = if (urlParts[1].isEmpty() && urlParts[2].startsWith("/static/")) { + baseUrl + urlParts[2] + } else { + urlParts[1] + urlParts[0] + urlParts[2] + } + pages.add(Page(i++, "", url)) } return pages } diff --git a/src/ru/readmanga/build.gradle b/src/ru/readmanga/build.gradle index 10efa73af..c048d320c 100644 --- a/src/ru/readmanga/build.gradle +++ b/src/ru/readmanga/build.gradle @@ -5,8 +5,8 @@ ext { appName = 'Tachiyomi: Readmanga' pkgNameSuffix = 'ru.readmanga' extClass = '.Readmanga' - extVersionCode = 6 - extVersionSuffix = 6 + extVersionCode = 7 + extVersionSuffix = 7 libVersion = '1.2' } diff --git a/src/ru/readmanga/src/eu/kanade/tachiyomi/extension/ru/readmanga/Readmanga.kt b/src/ru/readmanga/src/eu/kanade/tachiyomi/extension/ru/readmanga/Readmanga.kt index c69d4dcd3..25da94384 100644 --- a/src/ru/readmanga/src/eu/kanade/tachiyomi/extension/ru/readmanga/Readmanga.kt +++ b/src/ru/readmanga/src/eu/kanade/tachiyomi/extension/ru/readmanga/Readmanga.kt @@ -151,7 +151,12 @@ class Readmanga : ParsedHttpSource() { var i = 0 while (m.find()) { val urlParts = m.group().replace("[\"\']+".toRegex(), "").split(',') - pages.add(Page(i++, "", urlParts[1] + urlParts[0] + urlParts[2])) + val url = if (urlParts[1].isEmpty() && urlParts[2].startsWith("/static/")) { + baseUrl + urlParts[2] + } else { + urlParts[1] + urlParts[0] + urlParts[2] + } + pages.add(Page(i++, "", url)) } return pages }