Compare commits

..

No commits in common. "399e689969df0b276026781ac2df3288cc68fb07" and "463e6f85f63c4f94a26f01a223b5a0ee485112a6" have entirely different histories.

4 changed files with 6 additions and 5 deletions

View File

@ -105,8 +105,9 @@ class ChapterLoader(
is Format.Directory -> DirectoryPageLoader(format.file)
is Format.Zip -> ZipPageLoader(tempFileManager.createTempFile(format.file))
is Format.SevenZip -> try {
SevenZipPageLoader(tempFileManager.createTempFile(format.file)) {
GlobalScope.launchUI {
SevenZipPageLoader(tempFileManager.createTempFile(format.file))
{
GlobalScope.launchUI{
context.toast(context.stringResource(MR.strings.loader_7zip_slow_archives, it))
}
}

View File

@ -11,7 +11,7 @@ import java.io.File
*/
internal class SevenZipPageLoader(
private val file: File,
private val notifySlowArchive: (method: String) -> Unit,
private val notifySlowArchive: (method: String) -> Unit
) : PageLoader() {
private val zip by lazy { SevenZFile(file) }

View File

@ -26,7 +26,7 @@ object SevenZUtil {
.onEachIndexed { i, it ->
if (i > 0) return@onEachIndexed
val method = it.contentMethods.first().method
if (method !in GoodMethods) notifySlowArchives(method.name)
if(method !in GoodMethods) notifySlowArchives(method.name)
}
.sortedWith { f1, f2 -> f1.name.compareToCaseInsensitiveNaturalOrder(f2.name) }
.map(::getInputStream)

View File

@ -344,7 +344,7 @@ actual class LocalSource(
}
is Format.SevenZip -> {
SevenZFile(tempFileManager.createTempFile(format.file)).use { archive ->
val entry = archive.getImages {}.firstOrNull()
val entry = archive.getImages {} .firstOrNull()
entry?.let { coverManager.update(manga, it.inputStream()) }
}