Correct loading on covers and remove api when share (#5931)

This commit is contained in:
Eugene 2021-02-21 20:18:44 +05:00 committed by GitHub
parent 5cd789e2e7
commit 2582da9ae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Remanga'
pkgNameSuffix = 'ru.remanga'
extClass = '.Remanga'
extVersionCode = 18
extVersionCode = 19
libVersion = '1.2'
}

View File

@ -135,7 +135,9 @@ class Remanga : ConfigurableSource, HttpSource() {
// Do not change the title name to ensure work with a multilingual catalog!
title = en_name
url = "/api/titles/$dir/"
thumbnail_url = "$baseUrl/${img.high}"
thumbnail_url = if (img.high.isNotEmpty()) {
"$baseUrl/${img.high}"
} else "$baseUrl/${img.mid}"
}
private val simpleDateFormat by lazy { SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US) }
@ -244,7 +246,7 @@ class Remanga : ConfigurableSource, HttpSource() {
}
}
override fun mangaDetailsRequest(manga: SManga): Request {
return GET(baseUrl + "/manga/" + manga.url.substringAfter("/api/titles/", "/"), headers)
return GET(baseUrl.replace("api.", "") + "/manga/" + manga.url.substringAfter("/api/titles/", "/"), headers)
}
override fun mangaDetailsParse(response: Response): SManga {
val series = gson.fromJson<SeriesWrapperDto<MangaDetDto>>(response.body()?.charStream()!!)