Fix MangaRock for existing library items (#998)

This commit is contained in:
Eugene 2019-04-03 07:33:43 -04:00 committed by Carlos
parent 7607d4afe5
commit bf4100995a
2 changed files with 9 additions and 3 deletions

View File

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

View File

@ -175,8 +175,14 @@ class MangaRock : HttpSource() {
override fun chapterListRequest(manga: SManga) = getMangaApiRequest(manga)
private fun getMangaApiRequest(manga: SManga): Request {
val oid = manga.url.substringAfterLast("/")
return GET("$apiUrl/info?oid=$oid", headers)
return if (manga.url.contains("manga")) {
// Entries with "real" URL
val oid = manga.url.substringAfterLast("/")
GET("$apiUrl/info?oid=$oid", headers)
} else {
// Older entries with API URL
GET(apiUrl + manga.url, headers)
}
}
override fun mangaDetailsParse(response: Response) = SManga.create().apply {