feat: add BookOasis document reader and text settings
Update website / update_website (release) Waiting to run
Build & Test / Build & Test App (push) Has been cancelled

This commit is contained in:
2026-09-19 10:58:14 +09:00
parent 5848ffb4c4
commit 4900efbca5
20 changed files with 746 additions and 7 deletions
@@ -290,7 +290,13 @@ class LocalSource(
val chapters = fileSystem.getFilesInMangaDirectory(manga.url)
// Only keep supported formats
.filterNot { it.name.orEmpty().startsWith('.') }
.filter { it.isDirectory || Archive.isSupported(it) || it.extension.equals("epub", true) }
.filter {
it.isDirectory ||
Archive.isSupported(it) ||
it.extension.equals("epub", true) ||
it.extension.equals("pdf", true) ||
it.extension.equals("txt", true)
}
.map { chapterFile ->
SChapter.create().apply {
url = "${manga.url}/${chapterFile.name}"
@@ -385,6 +391,9 @@ class LocalSource(
entry?.let { coverManager.update(manga, epub.getInputStream(it)!!) }
}
}
is Format.Pdf,
is Format.Text,
-> null
}
} catch (e: Throwable) {
logcat(LogPriority.ERROR, e) { "Error updating cover for ${manga.title}" }
@@ -8,6 +8,8 @@ sealed interface Format {
data class Directory(val file: UniFile) : Format
data class Archive(val file: UniFile) : Format
data class Epub(val file: UniFile) : Format
data class Pdf(val file: UniFile) : Format
data class Text(val file: UniFile) : Format
class UnknownFormatException : Exception()
@@ -16,6 +18,8 @@ sealed interface Format {
fun valueOf(file: UniFile) = when {
file.isDirectory -> Directory(file)
file.extension.equals("epub", true) -> Epub(file)
file.extension.equals("pdf", true) -> Pdf(file)
file.extension.equals("txt", true) -> Text(file)
isArchiveSupported(file) -> Archive(file)
else -> throw UnknownFormatException()
}