Add Remangas (#2742)

* Add Remangas

* Fix lint

* Replace icons

* Add useLoadMoreRequest
This commit is contained in:
Chopper 2024-05-03 07:30:13 -03:00 committed by Draff
parent 2cf4736da0
commit 82ddc7daab
7 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,14 @@
ext {
extName = 'Remangas'
extClass = '.Remangas'
themePkg = 'madara'
baseUrl = 'https://remangas.net'
overrideVersionCode = 0
isNsfw = true
}
apply from: "$rootDir/common.gradle"
dependencies {
implementation project(':lib:randomua')
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,45 @@
package eu.kanade.tachiyomi.extension.pt.remangas
import android.app.Application
import android.content.SharedPreferences
import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.lib.randomua.addRandomUAPreferenceToScreen
import eu.kanade.tachiyomi.lib.randomua.getPrefCustomUA
import eu.kanade.tachiyomi.lib.randomua.getPrefUAType
import eu.kanade.tachiyomi.lib.randomua.setRandomUserAgent
import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.ConfigurableSource
import okhttp3.OkHttpClient
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.SimpleDateFormat
import java.util.Locale
class Remangas :
Madara(
"Remangas",
"https://remangas.net",
"pt-BR",
SimpleDateFormat("dd/MM/yyyy", Locale("pt", "BR")),
),
ConfigurableSource {
override val useLoadMoreRequest = LoadMoreStrategy.Always
private val preferences: SharedPreferences by lazy {
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
}
override val client: OkHttpClient = super.client.newBuilder()
.setRandomUserAgent(
preferences.getPrefUAType(),
preferences.getPrefCustomUA(),
)
.rateLimit(4)
.build()
override fun setupPreferenceScreen(screen: PreferenceScreen) {
addRandomUAPreferenceToScreen(screen)
}
}