Fix local chapters names (close #1323)
This commit is contained in:
@@ -37,6 +37,7 @@ import org.koitharu.kotatsu.parsers.model.MangaChapter
|
|||||||
import org.koitharu.kotatsu.parsers.model.MangaPage
|
import org.koitharu.kotatsu.parsers.model.MangaPage
|
||||||
import org.koitharu.kotatsu.parsers.util.longHashCode
|
import org.koitharu.kotatsu.parsers.util.longHashCode
|
||||||
import org.koitharu.kotatsu.parsers.util.runCatchingCancellable
|
import org.koitharu.kotatsu.parsers.util.runCatchingCancellable
|
||||||
|
import org.koitharu.kotatsu.parsers.util.toTitleCase
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,7 +114,7 @@ class LocalMangaParser(private val uri: Uri) {
|
|||||||
}.toString().removePrefix(Path.DIRECTORY_SEPARATOR)
|
}.toString().removePrefix(Path.DIRECTORY_SEPARATOR)
|
||||||
MangaChapter(
|
MangaChapter(
|
||||||
id = "$i$s".longHashCode(),
|
id = "$i$s".longHashCode(),
|
||||||
title = null,
|
title = p.userFriendlyName(),
|
||||||
number = 0f,
|
number = 0f,
|
||||||
volume = 0,
|
volume = 0,
|
||||||
source = LocalMangaSource,
|
source = LocalMangaSource,
|
||||||
@@ -220,6 +221,10 @@ class LocalMangaParser(private val uri: Uri) {
|
|||||||
e.printStackTraceDebug()
|
e.printStackTraceDebug()
|
||||||
}.getOrNull()
|
}.getOrNull()
|
||||||
|
|
||||||
|
private fun Path.userFriendlyName(): String = name.substringBeforeLast('.')
|
||||||
|
.replace('_', ' ')
|
||||||
|
.toTitleCase()
|
||||||
|
|
||||||
private class FsAndPath(
|
private class FsAndPath(
|
||||||
val fileSystem: FileSystem,
|
val fileSystem: FileSystem,
|
||||||
val path: Path,
|
val path: Path,
|
||||||
|
|||||||
Reference in New Issue
Block a user