[Ru] Remanga. Fix default popular sorting. Fix encoding pages to png (#4883)
* [Ru] Remanga. Fix default popular sorting. Fix encoding pages to png * Fix black parts of images Co-authored-by: pavkazzz <me@pavkazzz.ru>
This commit is contained in:
parent
9e2b6da01c
commit
484cfdd39f
@ -5,7 +5,7 @@ ext {
|
||||
extName = 'Remanga'
|
||||
pkgNameSuffix = 'ru.remanga'
|
||||
extClass = '.Remanga'
|
||||
extVersionCode = 8
|
||||
extVersionCode = 9
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ class Remanga : ConfigurableSource, HttpSource() {
|
||||
return user.content.access_token
|
||||
}
|
||||
|
||||
override fun popularMangaRequest(page: Int) = GET("$baseUrl/api/search/catalog/?ordering=rating&count=$count&page=$page", headers)
|
||||
override fun popularMangaRequest(page: Int) = GET("$baseUrl/api/search/catalog/?ordering=-rating&count=$count&page=$page", headers)
|
||||
|
||||
override fun popularMangaParse(response: Response): MangasPage = searchMangaParse(response)
|
||||
|
||||
@ -159,7 +159,7 @@ class Remanga : ConfigurableSource, HttpSource() {
|
||||
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
|
||||
when (filter) {
|
||||
is OrderBy -> {
|
||||
val ord = arrayOf("id", "chapter_date", "rating", "votes", "views", "ount_chapters", "random")[filter.state!!.index]
|
||||
val ord = arrayOf("id", "chapter_date", "rating", "votes", "views", "count_chapters", "random")[filter.state!!.index]
|
||||
url.addQueryParameter("ordering", if (filter.state!!.ascending) "$ord" else "-$ord")
|
||||
}
|
||||
is CategoryList -> filter.state.forEach { category ->
|
||||
@ -341,14 +341,18 @@ class Remanga : ConfigurableSource, HttpSource() {
|
||||
|
||||
val cs = Bitmap.createBitmap(b.width, b.height * pages.size, Bitmap.Config.ARGB_8888)
|
||||
val comboImage = Canvas(cs)
|
||||
var totalHeight = b.height
|
||||
comboImage.drawBitmap(b, 0f, 0f, null)
|
||||
for (i in 1 until pages.size) {
|
||||
val bytes = client.newCall(GET(pages[i], refererHeaders)).execute().body()!!.bytes()
|
||||
val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
|
||||
comboImage.drawBitmap(bitmap, 0f, (b.height * i).toFloat(), null)
|
||||
totalHeight += bitmap.getHeight()
|
||||
}
|
||||
cs.reconfigure(cs.getWidth(), totalHeight, cs.getConfig())
|
||||
|
||||
val output = ByteArrayOutputStream()
|
||||
cs.compress(Bitmap.CompressFormat.PNG, 100, output)
|
||||
cs.compress(Bitmap.CompressFormat.JPEG, 100, output)
|
||||
return Base64.encodeToString(output.toByteArray(), Base64.DEFAULT)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user