mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 03:14:40 -05: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
|
// should be bumped with each stable release
|
||||||
val tachideskVersion = System.getenv("ProductVersion") ?: "v0.5.1"
|
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
|
// counts commits on the master branch
|
||||||
val tachideskRevision = runCatching {
|
val tachideskRevision = runCatching {
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package eu.kanade.tachiyomi.source.local
|
|||||||
|
|
||||||
import com.github.junrar.Archive
|
import com.github.junrar.Archive
|
||||||
import eu.kanade.tachiyomi.source.local.FileSystemInterceptor.fakeUrlFrom
|
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.Directory
|
||||||
import eu.kanade.tachiyomi.source.local.LocalSource.Format.Epub
|
import eu.kanade.tachiyomi.source.local.LocalSource.Format.Epub
|
||||||
import eu.kanade.tachiyomi.source.local.LocalSource.Format.Rar
|
import eu.kanade.tachiyomi.source.local.LocalSource.Format.Rar
|
||||||
@@ -342,18 +344,14 @@ class LocalSource : HttpSource() {
|
|||||||
throw Exception("Chapter not found")
|
throw Exception("Chapter not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getFormat(file: File): Format {
|
private fun getFormat(file: File): Format = with(file) {
|
||||||
return with(file) {
|
when {
|
||||||
when {
|
isDirectory -> Format.Directory(this)
|
||||||
isDirectory -> Format.Directory(file)
|
extension.equals("zip", true) || extension.equals("cbz", true) -> Format.Zip(this)
|
||||||
extension.equals("zip", true) -> Format.Zip(file)
|
extension.equals("rar", true) || extension.equals("cbr", true) -> Format.Rar(this)
|
||||||
extension.equals("cbz", true) -> Format.Zip(file)
|
extension.equals("epub", true) -> Format.Epub(this)
|
||||||
extension.equals("rar", true) -> Format.Rar(file)
|
|
||||||
extension.equals("cbr", true) -> Format.Rar(file)
|
|
||||||
extension.equals("epub", true) -> Format.Epub(file)
|
|
||||||
|
|
||||||
else -> throw Exception("Invalid chapter format")
|
else -> throw Exception("Invalid chapter format")
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user