Created new cache/downloader

This commit is contained in:
tom5079
2020-08-31 11:41:12 +09:00
parent aa0e5000ab
commit c96d609803
10 changed files with 388 additions and 23 deletions

View File

@@ -25,6 +25,8 @@ import android.util.SparseArray
import androidx.preference.PreferenceManager
import com.google.firebase.crashlytics.FirebaseCrashlytics
import kotlinx.coroutines.*
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
@@ -41,6 +43,7 @@ import java.io.FileOutputStream
import java.io.InputStream
import java.net.URL
@Deprecated("Use downloader.Cache instead")
class Cache(context: Context) : ContextWrapper(context) {
companion object {

View File

@@ -48,6 +48,7 @@ import java.io.File
import java.io.IOException
import java.util.concurrent.LinkedBlockingQueue
@Deprecated("Use DownloadService instead")
@OptIn(ExperimentalCoroutinesApi::class)
class DownloadWorker private constructor(context: Context) : ContextWrapper(context) {

View File

@@ -22,12 +22,13 @@ import kotlinx.serialization.Serializable
import xyz.quaver.hitomi.GalleryBlock
import xyz.quaver.hitomi.Reader
@Deprecated("Use downloader.Cache.Metadata instead")
@Serializable
data class Metadata(
val thumbnail: String? = null,
val galleryBlock: GalleryBlock? = null,
val reader: Reader? = null,
val isDownloading: Boolean? = null
var thumbnail: String? = null,
var galleryBlock: GalleryBlock? = null,
var reader: Reader? = null,
var isDownloading: Boolean? = null
) {
constructor(
metadata: Metadata?,