Skip to content

Commit

Permalink
Update parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
Koitharu committed Nov 10, 2024
1 parent 7c2c037 commit 30e04eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
testImplementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.9.0")
implementation("com.github.ajalt.clikt:clikt-core:5.0.1")
implementation("com.github.KotatsuApp:kotatsu-parsers:08fe54c36d")
implementation("com.github.KotatsuApp:kotatsu-parsers:f3d14e101c")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("com.squareup.okio:okio:3.9.0")
implementation("io.webfolder:quickjs:1.1.0")
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/org/koitharu/kotatsu/dl/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import org.koitharu.kotatsu.dl.ui.askSelectBranch
import org.koitharu.kotatsu.dl.util.AppCommand
import org.koitharu.kotatsu.dl.util.ChaptersRange
import org.koitharu.kotatsu.dl.util.colored
import org.koitharu.kotatsu.parsers.model.MangaParserSource
import java.io.File

class Main : AppCommand(name = "kotatsu-dl") {
Expand Down Expand Up @@ -68,7 +69,7 @@ class Main : AppCommand(name = "kotatsu-dl") {
print("Resolving link…")
val source = linkResolver.getSource()
val manga = linkResolver.getManga()
if (source == null) {
if (source == null || source == MangaParserSource.DUMMY) {
println()
error("Unsupported manga source")
}
Expand Down Expand Up @@ -101,7 +102,7 @@ class Main : AppCommand(name = "kotatsu-dl") {
print("==>".green)
print(' ')
}
ChaptersRange.parse(readLine())
ChaptersRange.parse(readlnOrNull())
} else {
ChaptersRange.all()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fun askSelectBranch(chapters: List<MangaChapter>): List<MangaChapter> {
print("==>".green)
print(' ')
}
val userInput = readLine()?.trim().ifNullOrEmpty { "1" }
val userInput = readlnOrNull()?.trim().ifNullOrEmpty { "1" }
val branch = branches[userInput.toInt() - 1].first
return chapters.filter { chapter -> chapter.branch == branch }
} else {
Expand Down

0 comments on commit 30e04eb

Please sign in to comment.