mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2026-01-04 10:52:34 +01:00
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:
@@ -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 -> {
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user