actaully make sure the chapter exists

This commit is contained in:
Aria Moradi
2021-09-17 00:38:15 +04:30
parent 8e6b219eea
commit 4e72a3886f
3 changed files with 26 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ object CachedImageResponse {
return FileInputStream(path).buffered()
}
private fun findFileNameStartingWith(directoryPath: String, fileName: String): String? {
fun findFileNameStartingWith(directoryPath: String, fileName: String): String? {
val target = "$fileName."
File(directoryPath).listFiles().orEmpty().forEach { file ->
if (file.name.startsWith(target))