Skip to content

Commit

Permalink
update rate limit + dep
Browse files Browse the repository at this point in the history
  • Loading branch information
LagradOst committed Jun 26, 2024
1 parent aa38114 commit 28c536c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
24 changes: 12 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,40 +55,40 @@ repositories {

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'org.jsoup:jsoup:1.15.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.5'
implementation 'org.jsoup:jsoup:1.17.2'
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'com.github.bumptech.glide:glide:4.15.1'
androidTestImplementation 'androidx.test.ext:junit:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.0'
implementation 'com.github.bumptech.glide:glide:4.16.0'
kapt 'com.github.bumptech.glide:compiler:4.13.1'
implementation 'jp.wasabeef:glide-transformations:4.3.0'
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.13.1"
implementation "androidx.preference:preference-ktx:1.2.0"
implementation "androidx.preference:preference-ktx:1.2.1"

implementation('nl.siegmann.epublib:epublib-core:3.1') {
exclude group: 'org.slf4j'
exclude group: 'xmlpull'
}
implementation 'org.slf4j:slf4j-android:1.7.25'

implementation "androidx.recyclerview:recyclerview:1.3.0"
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.18'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'

implementation("com.google.android.material:material:1.5.0")
implementation("com.google.android.material:material:1.12.0")

implementation 'androidx.media:media:1.6.0'
implementation 'androidx.media:media:1.7.0'
implementation 'com.github.LagradOst:SafeFile:0.0.6' // To Prevent the URI File Fu*kery
implementation 'com.jaredrummler:colorpicker:1.1.0'

implementation 'com.github.Blatzar:NiceHttp:0.4.4'
implementation 'com.github.Blatzar:NiceHttp:0.4.11'

implementation "io.noties.markwon:core:4.6.2"
implementation "io.noties.markwon:image-glide:4.6.2"
Expand Down
9 changes: 6 additions & 3 deletions app/src/main/java/com/lagradost/quicknovel/BookDownloader2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -589,12 +589,15 @@ object BookDownloader2Helper {
if (!page.isNullOrBlank()) {
rFile.createNewFile() // only create the file when actually needed
rFile.writeText("${data.name}\n${page}")
if (api.rateLimitTime > 0) {
delay(api.rateLimitTime)
}
return@withContext true
} else {
delay(5000) // ERROR
}
if (api.rateLimitTime > 0) {
delay(api.rateLimitTime)
if (api.rateLimitTime > 0) {
delay(api.rateLimitTime)
}
}
} finally {
if (rateLimit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import java.util.Date
class RoyalRoadProvider : MainAPI() {
override val name = "Royal Road"
override val mainUrl = "https://www.royalroad.com"
override val rateLimitTime = 5000L
override val rateLimitTime = 500L
override val hasMainPage = true

override val iconId = R.drawable.big_icon_royalroad
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class ResultFragment : Fragment() {
val res = loadResponse.value

binding.apply {
downloadWarning.isVisible = api.rateLimitTime > 1000
downloadWarning.isVisible = api.rateLimitTime > 2000

res.image?.let { img ->
resultEmptyView.setOnClickListener {
Expand Down

0 comments on commit 28c536c

Please sign in to comment.