~gardenapple/mitch

d000e785bc2e188ba6c937f7fc81f69f5d6555ef — gardenapple 3 months ago 785bb38
Optimize imports
M app/src/main/java/ua/gardenapple/itchupdater/Utils.kt => app/src/main/java/ua/gardenapple/itchupdater/Utils.kt +0 -1
@@ 22,7 22,6 @@ import androidx.annotation.ColorInt
import androidx.annotation.ColorRes
import androidx.core.content.FileProvider
import androidx.core.graphics.ColorUtils
import androidx.work.Data
import com.github.ajalt.colormath.ConvertibleColor
import com.github.ajalt.colormath.fromCss
import kotlinx.coroutines.Dispatchers

M app/src/main/java/ua/gardenapple/itchupdater/client/ItchLibraryParser.kt => app/src/main/java/ua/gardenapple/itchupdater/client/ItchLibraryParser.kt +0 -2
@@ 9,8 9,6 @@ import org.json.JSONObject
import org.jsoup.Jsoup
import ua.gardenapple.itchupdater.Mitch
import java.io.IOException
import java.util.*
import kotlin.collections.ArrayList

object ItchLibraryParser {
    private const val LOGGING_TAG = "ItchLibraryParser"

M app/src/main/java/ua/gardenapple/itchupdater/client/ItchWebsiteParser.kt => app/src/main/java/ua/gardenapple/itchupdater/client/ItchWebsiteParser.kt +0 -1
@@ 19,7 19,6 @@ import ua.gardenapple.itchupdater.database.game.Game
import ua.gardenapple.itchupdater.database.installation.Installation
import java.io.IOException
import java.util.*
import kotlin.collections.ArrayList

object ItchWebsiteParser {
    class UploadNotFoundException(uploadId: Int) : RuntimeException(uploadId.toString())

M app/src/main/java/ua/gardenapple/itchupdater/client/SpecialBundleHandler.kt => app/src/main/java/ua/gardenapple/itchupdater/client/SpecialBundleHandler.kt +2 -1
@@ 10,7 10,8 @@ import kotlinx.coroutines.withContext
import okhttp3.FormBody
import okhttp3.Request
import org.jsoup.nodes.Document
import ua.gardenapple.itchupdater.*
import ua.gardenapple.itchupdater.ItchWebsiteUtils
import ua.gardenapple.itchupdater.Mitch
import ua.gardenapple.itchupdater.data.SpecialBundle
import ua.gardenapple.itchupdater.database.game.Game
import java.net.URL

M app/src/main/java/ua/gardenapple/itchupdater/files/DownloadFileManager.kt => app/src/main/java/ua/gardenapple/itchupdater/files/DownloadFileManager.kt +0 -5
@@ 2,13 2,8 @@ package ua.gardenapple.itchupdater.files

import android.content.Context
import android.util.Log
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import ua.gardenapple.itchupdater.NOTIFICATION_CHANNEL_ID_INSTALLING
import ua.gardenapple.itchupdater.NOTIFICATION_TAG_DOWNLOAD
import ua.gardenapple.itchupdater.R
import ua.gardenapple.itchupdater.database.AppDatabase
import ua.gardenapple.itchupdater.database.installation.Installation
import ua.gardenapple.itchupdater.install.AbstractInstaller

M app/src/main/java/ua/gardenapple/itchupdater/install/AbstractInstaller.kt => app/src/main/java/ua/gardenapple/itchupdater/install/AbstractInstaller.kt +2 -1
@@ 1,7 1,8 @@
package ua.gardenapple.itchupdater.install

import android.content.Context
import java.io.*
import java.io.File
import java.io.OutputStream

abstract class AbstractInstaller {
    enum class Type {

M app/src/main/java/ua/gardenapple/itchupdater/install/InstallRequestBroadcastReceiver.kt => app/src/main/java/ua/gardenapple/itchupdater/install/InstallRequestBroadcastReceiver.kt +2 -0
@@ 7,6 7,8 @@ import android.util.Log
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import ua.gardenapple.itchupdater.Utils
import ua.gardenapple.itchupdater.install.InstallRequestBroadcastReceiver.Companion.EXTRA_DOWNLOAD_ID
import ua.gardenapple.itchupdater.install.InstallRequestBroadcastReceiver.Companion.EXTRA_STREAM_SESSION_ID
import java.io.File

/**

M app/src/main/java/ua/gardenapple/itchupdater/install/NativeInstaller.kt => app/src/main/java/ua/gardenapple/itchupdater/install/NativeInstaller.kt +0 -2
@@ 7,9 7,7 @@ import androidx.core.net.toUri
import ua.gardenapple.itchupdater.Mitch
import ua.gardenapple.itchupdater.database.AppDatabase
import java.io.File
import java.io.InputStream
import java.io.OutputStream
import java.io.PipedOutputStream

class NativeInstaller : AbstractInstaller() {
    companion object {

M app/src/main/java/ua/gardenapple/itchupdater/install/SessionInstaller.kt => app/src/main/java/ua/gardenapple/itchupdater/install/SessionInstaller.kt +5 -3
@@ 5,10 5,12 @@ import android.content.Context
import android.content.Intent
import android.content.pm.PackageInstaller
import android.util.Log
import kotlinx.coroutines.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import ua.gardenapple.itchupdater.Mitch
import ua.gardenapple.itchupdater.Utils
import java.io.*
import java.io.File
import java.io.IOException
import java.io.OutputStream

class SessionInstaller : AbstractInstaller() {
    class NotEnoughSpaceException(message: String? = null, cause: IOException? = null) : IOException(message, cause)

M app/src/main/java/ua/gardenapple/itchupdater/install/SessionInstallerService.kt => app/src/main/java/ua/gardenapple/itchupdater/install/SessionInstallerService.kt +0 -1
@@ 7,7 7,6 @@ import android.os.IBinder
import android.util.Log
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import ua.gardenapple.itchupdater.Mitch
import ua.gardenapple.itchupdater.Utils

/**

M app/src/main/java/ua/gardenapple/itchupdater/ui/LibraryFragment.kt => app/src/main/java/ua/gardenapple/itchupdater/ui/LibraryFragment.kt +4 -3
@@ 10,14 10,15 @@ import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.work.*
import com.bumptech.glide.Glide
import com.bumptech.glide.ListPreloader
import com.bumptech.glide.RequestBuilder
import com.bumptech.glide.integration.recyclerview.RecyclerViewPreloader
import com.bumptech.glide.util.FixedPreloadSizeProvider
import kotlinx.coroutines.*
import ua.gardenapple.itchupdater.database.game.*
import ua.gardenapple.itchupdater.database.game.GameDownloadsViewModel
import ua.gardenapple.itchupdater.database.game.GameRepository
import ua.gardenapple.itchupdater.database.game.InstalledGameViewModel
import ua.gardenapple.itchupdater.database.game.PendingGameViewModel
import ua.gardenapple.itchupdater.database.installation.GameInstallation
import ua.gardenapple.itchupdater.databinding.LibraryFragmentBinding
import java.util.*

M app/src/main/java/ua/gardenapple/itchupdater/ui/MainActivity.kt => app/src/main/java/ua/gardenapple/itchupdater/ui/MainActivity.kt +4 -1
@@ 19,7 19,10 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction
import androidx.preference.PreferenceManager
import com.google.android.material.bottomnavigation.BottomNavigationView
import kotlinx.coroutines.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import ua.gardenapple.itchupdater.*
import ua.gardenapple.itchupdater.database.AppDatabase
import ua.gardenapple.itchupdater.databinding.ActivityMainBinding

M app/src/main/java/ua/gardenapple/itchupdater/ui/OwnedGamesActivity.kt => app/src/main/java/ua/gardenapple/itchupdater/ui/OwnedGamesActivity.kt +0 -1
@@ 15,7 15,6 @@ import androidx.paging.LoadState
import androidx.preference.PreferenceManager
import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.distinctUntilChangedBy
import kotlinx.coroutines.flow.filter

M app/src/main/java/ua/gardenapple/itchupdater/ui/UpdatesFragment.kt => app/src/main/java/ua/gardenapple/itchupdater/ui/UpdatesFragment.kt +4 -1
@@ 13,7 13,10 @@ import com.bumptech.glide.ListPreloader
import com.bumptech.glide.RequestBuilder
import com.bumptech.glide.integration.recyclerview.RecyclerViewPreloader
import com.bumptech.glide.util.FixedPreloadSizeProvider
import kotlinx.coroutines.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import ua.gardenapple.itchupdater.client.UpdateChecker
import ua.gardenapple.itchupdater.database.updatecheck.InstallUpdateCheckResult
import ua.gardenapple.itchupdater.database.updatecheck.UpdateCheckResultViewModel