new icon color fixed sorting issue [12:28 AM] some nice gui stuff for downloading [12:28 AM] yomiroll preferences bug [12:28 AM] background no longer stuck on black
This commit is contained in:
parent
f7917df907
commit
a1913ed968
30 changed files with 531 additions and 83 deletions
|
@ -3,6 +3,7 @@ package ani.dantotsu.parsers
|
|||
import android.os.Environment
|
||||
import ani.dantotsu.currContext
|
||||
import ani.dantotsu.download.DownloadsManager
|
||||
import ani.dantotsu.logger
|
||||
import ani.dantotsu.media.manga.MangaNameAdapter
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
|
@ -47,6 +48,7 @@ class OfflineMangaParser: MangaParser() {
|
|||
"Dantotsu/Manga/$chapterLink"
|
||||
)
|
||||
val images = mutableListOf<MangaImage>()
|
||||
val imageNumberRegex = Regex("""(\d+)\.jpg$""")
|
||||
if (directory.exists()) {
|
||||
directory.listFiles()?.forEach {
|
||||
if (it.isFile) {
|
||||
|
@ -54,6 +56,13 @@ class OfflineMangaParser: MangaParser() {
|
|||
images.add(image)
|
||||
}
|
||||
}
|
||||
images.sortBy { image ->
|
||||
val matchResult = imageNumberRegex.find(image.url.url)
|
||||
matchResult?.groups?.get(1)?.value?.toIntOrNull() ?: Int.MAX_VALUE
|
||||
}
|
||||
for (image in images) {
|
||||
logger("imageNumber: ${image.url.url}")
|
||||
}
|
||||
return images
|
||||
}
|
||||
return emptyList()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue