mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-01 01:44:34 -05: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)) {
|
return when (getFormat(chapterFile)) {
|
||||||
is Directory -> {
|
is Directory -> {
|
||||||
Observable.just(
|
Observable.just(
|
||||||
chapterFile.listFiles().orEmpty().sortedBy { it.name }.mapIndexed { index, page ->
|
chapterFile.listFiles().orEmpty()
|
||||||
Page(
|
.sortedBy { it.name }
|
||||||
index,
|
.filter { !it.isDirectory && ImageUtil.isImage(it.name, it::inputStream)
|
||||||
imageUrl = applicationDirs.localMangaRoot + "/" + chapter.url + "/" + page.name
|
.mapIndexed { index, page ->
|
||||||
)
|
Page(
|
||||||
}
|
index,
|
||||||
|
imageUrl = applicationDirs.localMangaRoot + "/" + chapter.url + "/" + page.name
|
||||||
|
)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
is Zip -> {
|
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.PageTable
|
||||||
import suwayomi.tachidesk.manga.model.table.toDataClass
|
import suwayomi.tachidesk.manga.model.table.toDataClass
|
||||||
|
|
||||||
|
|
||||||
suspend fun getChapterDownloadReady(chapterIndex: Int, mangaId: Int): ChapterDataClass {
|
suspend fun getChapterDownloadReady(chapterIndex: Int, mangaId: Int): ChapterDataClass {
|
||||||
val chapter = ChapterForDownload(chapterIndex, mangaId)
|
val chapter = ChapterForDownload(chapterIndex, mangaId)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user