ignore non image files (#269)

* ignore non image files

* Update server/src/main/kotlin/eu/kanade/tachiyomi/source/local/LocalSource.kt

Co-authored-by: Mitchell Syer <Mitchellptbo@gmail.com>

Co-authored-by: Mitchell Syer <Mitchellptbo@gmail.com>
This commit is contained in:
Aria Moradi
2021-12-03 20:53:18 +03:30
committed by GitHub
parent 76c7bdd604
commit b68fdb0772
2 changed files with 9 additions and 7 deletions

View File

@@ -293,12 +293,15 @@ class LocalSource : CatalogueSource {
return when (getFormat(chapterFile)) {
is Directory -> {
Observable.just(
chapterFile.listFiles().orEmpty().sortedBy { it.name }.mapIndexed { index, page ->
Page(
index,
imageUrl = applicationDirs.localMangaRoot + "/" + chapter.url + "/" + page.name
)
}
chapterFile.listFiles().orEmpty()
.sortedBy { it.name }
.filter { !it.isDirectory && ImageUtil.isImage(it.name, it::inputStream)
.mapIndexed { index, page ->
Page(
index,
imageUrl = applicationDirs.localMangaRoot + "/" + chapter.url + "/" + page.name
)
}
)
}
is Zip -> {

View File

@@ -26,7 +26,6 @@ import suwayomi.tachidesk.manga.model.table.MangaTable
import suwayomi.tachidesk.manga.model.table.PageTable
import suwayomi.tachidesk.manga.model.table.toDataClass
suspend fun getChapterDownloadReady(chapterIndex: Int, mangaId: Int): ChapterDataClass {
val chapter = ChapterForDownload(chapterIndex, mangaId)