mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix indents of last commits
This commit is contained in:
parent
bf746dd7fb
commit
b69d856642
2 changed files with 22 additions and 21 deletions
|
@ -14,8 +14,6 @@ import eu.kanade.tachiyomi.util.system.toast
|
|||
import eu.kanade.tachiyomi.util.system.withIOContext
|
||||
import eu.kanade.tachiyomi.util.system.withUIContext
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import timber.log.Timber
|
||||
import uy.kohesive.injekt.Injekt
|
||||
|
@ -97,24 +95,24 @@ class CoverCache(val context: Context) {
|
|||
* Clear out all online covers
|
||||
*/
|
||||
suspend fun deleteAllCachedCovers() {
|
||||
val directory = onlineCoverDirectory
|
||||
var deletedSize = 0L
|
||||
val files =
|
||||
directory.listFiles()?.sortedBy { it.lastModified() }?.iterator() ?: return
|
||||
while (files.hasNext()) {
|
||||
val file = files.next()
|
||||
deletedSize += file.length()
|
||||
file.delete()
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
context.toast(
|
||||
context.getString(
|
||||
R.string.deleted_,
|
||||
Formatter.formatFileSize(context, deletedSize)
|
||||
)
|
||||
val directory = onlineCoverDirectory
|
||||
var deletedSize = 0L
|
||||
val files =
|
||||
directory.listFiles()?.sortedBy { it.lastModified() }?.iterator() ?: return
|
||||
while (files.hasNext()) {
|
||||
val file = files.next()
|
||||
deletedSize += file.length()
|
||||
file.delete()
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
context.toast(
|
||||
context.getString(
|
||||
R.string.deleted_,
|
||||
Formatter.formatFileSize(context, deletedSize)
|
||||
)
|
||||
}
|
||||
context.imageLoader.memoryCache.clear()
|
||||
)
|
||||
}
|
||||
context.imageLoader.memoryCache.clear()
|
||||
|
||||
lastClean = System.currentTimeMillis()
|
||||
}
|
||||
|
|
|
@ -201,8 +201,11 @@ class DownloadService : Service() {
|
|||
private fun onNetworkStateChanged() {
|
||||
val manager = connectivityManager
|
||||
val networkCapabilities = manager.getNetworkCapabilities(manager.activeNetwork)
|
||||
if (networkCapabilities == null || !(networkCapabilities.hasCapability(NET_CAPABILITY_INTERNET) &&
|
||||
networkCapabilities.hasCapability(NET_CAPABILITY_VALIDATED))) {
|
||||
if (networkCapabilities == null || !(
|
||||
networkCapabilities.hasCapability(NET_CAPABILITY_INTERNET) &&
|
||||
networkCapabilities.hasCapability(NET_CAPABILITY_VALIDATED)
|
||||
)
|
||||
) {
|
||||
downloadManager.stopDownloads(getString(R.string.no_network_connection))
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue