mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2025-12-10 14:52:05 +01:00
Minor cleanup
This commit is contained in:
@@ -14,7 +14,7 @@ const val MainClass = "suwayomi.tachidesk.MainKt"
|
||||
// should be bumped with each stable release
|
||||
val tachideskVersion = System.getenv("ProductVersion") ?: "v0.5.1"
|
||||
|
||||
val webUIRevisionTag = System.getenv("WebUIRevision") ?: "r803"
|
||||
val webUIRevisionTag = System.getenv("WebUIRevision") ?: "r804"
|
||||
|
||||
// counts commits on the master branch
|
||||
val tachideskRevision = runCatching {
|
||||
|
||||
@@ -2,6 +2,8 @@ package eu.kanade.tachiyomi.source.local
|
||||
|
||||
import com.github.junrar.Archive
|
||||
import eu.kanade.tachiyomi.source.local.FileSystemInterceptor.fakeUrlFrom
|
||||
import eu.kanade.tachiyomi.source.local.Format.Directory
|
||||
import eu.kanade.tachiyomi.source.local.Format.Zip
|
||||
import eu.kanade.tachiyomi.source.local.LocalSource.Format.Directory
|
||||
import eu.kanade.tachiyomi.source.local.LocalSource.Format.Epub
|
||||
import eu.kanade.tachiyomi.source.local.LocalSource.Format.Rar
|
||||
@@ -342,20 +344,16 @@ class LocalSource : HttpSource() {
|
||||
throw Exception("Chapter not found")
|
||||
}
|
||||
|
||||
private fun getFormat(file: File): Format {
|
||||
return with(file) {
|
||||
private fun getFormat(file: File): Format = with(file) {
|
||||
when {
|
||||
isDirectory -> Format.Directory(file)
|
||||
extension.equals("zip", true) -> Format.Zip(file)
|
||||
extension.equals("cbz", true) -> Format.Zip(file)
|
||||
extension.equals("rar", true) -> Format.Rar(file)
|
||||
extension.equals("cbr", true) -> Format.Rar(file)
|
||||
extension.equals("epub", true) -> Format.Epub(file)
|
||||
isDirectory -> Format.Directory(this)
|
||||
extension.equals("zip", true) || extension.equals("cbz", true) -> Format.Zip(this)
|
||||
extension.equals("rar", true) || extension.equals("cbr", true) -> Format.Rar(this)
|
||||
extension.equals("epub", true) -> Format.Epub(this)
|
||||
|
||||
else -> throw Exception("Invalid chapter format")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateCover(chapter: SChapter, manga: SManga): File? {
|
||||
return when (val format = getFormat(chapter)) {
|
||||
|
||||
Reference in New Issue
Block a user