From cc4e994682b09b2500119e82b19b3d170685659d Mon Sep 17 00:00:00 2001 From: semenvav Date: Mon, 7 Aug 2023 01:12:42 +0300 Subject: [PATCH] delete useless code --- .../more/download/DownloadStatsScreenModel.kt | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/download/DownloadStatsScreenModel.kt b/app/src/main/java/eu/kanade/presentation/more/download/DownloadStatsScreenModel.kt index caa661e369..8366a3de38 100644 --- a/app/src/main/java/eu/kanade/presentation/more/download/DownloadStatsScreenModel.kt +++ b/app/src/main/java/eu/kanade/presentation/more/download/DownloadStatsScreenModel.kt @@ -22,8 +22,6 @@ import uy.kohesive.injekt.api.get import uy.kohesive.injekt.injectLazy import java.io.File import java.util.TreeMap -import java.util.zip.ZipEntry -import java.util.zip.ZipFile class DownloadStatsScreenModel( private val getLibraryManga: GetLibraryManga = Injekt.get(), @@ -99,34 +97,15 @@ class DownloadStatsScreenModel( } private fun getFileSize(file: File): Long { - val archiveFormats = setOf(".zip", ".cbz", ".rar", ".cbr") return if (file.isDirectory) { getFolderSize(file.path) } else if (file.isFile) { file.length() - } else if (file.extension.lowercase() in archiveFormats) { - getZipFileSize(file) } else { 0 } } - private fun getZipFileSize(file: File): Long { - var size: Long = 0 - - val zipFile = ZipFile(file) - val entries = zipFile.entries() - - while (entries.hasMoreElements()) { - val entry: ZipEntry = entries.nextElement() - size += entry.size - } - - zipFile.close() - - return size - } - fun runSortAction(mode: SortingMode) { when (mode) { SortingMode.BY_ALPHABET -> sortByAlphabet()