diff --git a/source-local/src/commonMain/kotlin/tachiyomi/source/local/io/Archive.kt b/source-local/src/commonMain/kotlin/tachiyomi/source/local/io/Archive.kt index e894a3ac94..f8b1f60089 100644 --- a/source-local/src/commonMain/kotlin/tachiyomi/source/local/io/Archive.kt +++ b/source-local/src/commonMain/kotlin/tachiyomi/source/local/io/Archive.kt @@ -1,15 +1,13 @@ package tachiyomi.source.local.io import com.hippo.unifile.UniFile +import tachiyomi.core.common.storage.extension object Archive { private val SUPPORTED_ARCHIVE_TYPES = listOf("zip", "cbz", "rar", "cbr", "7z", "cb7", "tar", "cbt", "epub") fun isSupported(file: UniFile): Boolean { - val name = file.name?.lowercase() ?: return false - val extension = name.substringAfterLast('.') - val nameWithoutExtension = name.substringBeforeLast('.') - return extension in SUPPORTED_ARCHIVE_TYPES + return file.extension?.lowercase() in SUPPORTED_ARCHIVE_TYPES } }