Manga Rock: throw slightly more informative exception for licensed manga

This commit is contained in:
arkon 2020-01-01 10:59:39 -05:00
parent e1abb544e4
commit b55554acb6
No known key found for this signature in database
GPG Key ID: E1FD745328866B0A
2 changed files with 8 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Manga Rock'
pkgNameSuffix = 'en.mangarock'
extClass = '.MangaRock'
extVersionCode = 14
extVersionCode = 15
libVersion = '1.2'
}

View File

@ -231,7 +231,13 @@ class MangaRock : HttpSource() {
}
override fun chapterListParse(response: Response): List<SChapter> {
val obj = JSONObject(response.body()!!.string()).getJSONObject("data")
val body = response.body()!!.string()
if (body == "Manga is licensed") {
throw Exception("Manga has been removed from Manga Rock, please migrate to another source")
}
val obj = JSONObject(body).getJSONObject("data")
val chapters = ArrayList<SChapter>()
val arr = obj.getJSONArray("chapters")
// Iterate backwards to match website's sorting