Skip to content
This repository has been archived by the owner on Dec 4, 2022. It is now read-only.

Commit

Permalink
Use startIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
Doomsdayrs committed Apr 22, 2022
1 parent 877e2a5 commit c75b4d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "com.github.doomsdayrs.lib"
version = "0.1.0"
version = "0.1.1"

repositories {
mavenCentral()
Expand Down
20 changes: 13 additions & 7 deletions src/main/kotlin/Test.kt
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,13 @@ fun main(args: Array<String>) {
println("Settings : $settingsModel")
println("Filters : $searchFiltersModel")
if (PRINT_METADATA)
println("MetaData : ${Json { prettyPrint = true }.encodeToString(extension.exMetaData)}")
println(
"MetaData : ${
Json {
prettyPrint = true
}.encodeToString(extension.exMetaData)
}"
)
println(CRESET)

extension.listings.forEach { l ->
Expand All @@ -295,30 +301,30 @@ fun main(args: Array<String>) {
var novels = getListing(
HashMap(searchFiltersModel).apply {
this[PAGE_INDEX] =
if (isIncrementing) 1 else null
if (isIncrementing) extension.startIndex else null

}
)

if (isIncrementing)
novels += getListing(HashMap(searchFiltersModel)
.apply {
this[PAGE_INDEX] = 2
this[PAGE_INDEX] = extension.startIndex + 1
})

if (REPEAT) {
novels = getListing(
HashMap(searchFiltersModel).apply {
this[PAGE_INDEX] =
if (isIncrementing) 1 else null
if (isIncrementing) extension.startIndex else null

}
)

if (isIncrementing)
novels += getListing(HashMap(searchFiltersModel)
.apply {
this[PAGE_INDEX] = 2
this[PAGE_INDEX] = extension.startIndex + 1
})
}

Expand All @@ -340,7 +346,7 @@ fun main(args: Array<String>) {
extension.search(
HashMap(searchFiltersModel).apply {
set(QUERY_INDEX, SEARCH_VALUE)
set(PAGE_INDEX, 0)
set(PAGE_INDEX, extension.startIndex)
}
)
}
Expand All @@ -352,7 +358,7 @@ fun main(args: Array<String>) {
extension.search(
HashMap(searchFiltersModel).apply {
set(QUERY_INDEX, SEARCH_VALUE)
set(PAGE_INDEX, 2)
set(PAGE_INDEX, extension.startIndex + 1)
}
)
}
Expand Down

0 comments on commit c75b4d3

Please sign in to comment.