mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-06-20 22:29:19 +00:00
Update: Replace entity's Product usage with database.entity's fully
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
package com.looker.droidify.index
|
||||
|
||||
import com.looker.droidify.database.entity.Product
|
||||
import com.looker.droidify.database.entity.Release
|
||||
import com.looker.droidify.entity.Author
|
||||
import com.looker.droidify.entity.Donate
|
||||
import com.looker.droidify.entity.Product
|
||||
import com.looker.droidify.utility.extension.android.Android
|
||||
import org.xml.sax.Attributes
|
||||
import org.xml.sax.helpers.DefaultHandler
|
||||
@ -89,32 +89,30 @@ class IndexHandler(private val repositoryId: Long, private val callback: Callbac
|
||||
val donates = mutableListOf<Donate>()
|
||||
val releases = mutableListOf<Release>()
|
||||
|
||||
fun build(): Product {
|
||||
return Product(
|
||||
repositoryId,
|
||||
packageName,
|
||||
name,
|
||||
summary,
|
||||
description,
|
||||
"",
|
||||
icon,
|
||||
"",
|
||||
Author(authorName, authorEmail, ""),
|
||||
source,
|
||||
changelog,
|
||||
web,
|
||||
tracker,
|
||||
added,
|
||||
updated,
|
||||
suggestedVersionCode,
|
||||
categories.toList(),
|
||||
antiFeatures.toList(),
|
||||
licenses,
|
||||
donates.sortedWith(DonateComparator),
|
||||
emptyList(),
|
||||
releases
|
||||
)
|
||||
}
|
||||
fun build(): Product = Product(
|
||||
repositoryId = repositoryId,
|
||||
packageName = packageName,
|
||||
name = name,
|
||||
summary = summary,
|
||||
description = description,
|
||||
added = added,
|
||||
updated = updated,
|
||||
icon = icon,
|
||||
metadataIcon = "",
|
||||
releases = releases,
|
||||
categories = categories.toList(),
|
||||
antiFeatures = antiFeatures.toList(),
|
||||
licenses = licenses,
|
||||
donates = donates.sortedWith(DonateComparator),
|
||||
screenshots = emptyList(),
|
||||
suggestedVersionCode = suggestedVersionCode,
|
||||
author = Author(authorName, authorEmail, ""),
|
||||
source = source,
|
||||
web = web,
|
||||
tracker = tracker,
|
||||
changelog = changelog,
|
||||
whatsNew = ""
|
||||
)
|
||||
}
|
||||
|
||||
private class ReleaseBuilder {
|
||||
|
@ -4,8 +4,8 @@ import android.content.ContentValues
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import com.looker.droidify.database.Converters.toByteArray
|
||||
import com.looker.droidify.database.Converters.toReleases
|
||||
import com.looker.droidify.database.entity.Product
|
||||
import com.looker.droidify.database.entity.Release
|
||||
import com.looker.droidify.entity.Product
|
||||
import com.looker.droidify.utility.extension.android.asSequence
|
||||
import com.looker.droidify.utility.extension.android.execWithResult
|
||||
import java.io.ByteArrayOutputStream
|
||||
@ -67,8 +67,11 @@ class IndexMerger(file: File) : Closeable {
|
||||
this.repositoryId = repositoryId
|
||||
this.description = description
|
||||
}
|
||||
val releases = it.getBlob(2)?.let { toReleases(it) }.orEmpty()
|
||||
product.copy(releases = releases)
|
||||
val releases = it.getBlob(2)?.let(::toReleases).orEmpty()
|
||||
product.apply {
|
||||
this.releases = releases
|
||||
refreshVariables()
|
||||
}
|
||||
}.windowed(windowSize, windowSize, true)
|
||||
.forEach { products -> callback(products, it.count) }
|
||||
}
|
||||
|
@ -2,10 +2,10 @@ package com.looker.droidify.index
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser
|
||||
import com.fasterxml.jackson.core.JsonToken
|
||||
import com.looker.droidify.database.entity.Product
|
||||
import com.looker.droidify.database.entity.Release
|
||||
import com.looker.droidify.entity.Author
|
||||
import com.looker.droidify.entity.Donate
|
||||
import com.looker.droidify.entity.Product
|
||||
import com.looker.droidify.entity.Screenshot
|
||||
import com.looker.droidify.utility.extension.android.Android
|
||||
import com.looker.droidify.utility.extension.json.*
|
||||
@ -217,28 +217,28 @@ object IndexV1Parser {
|
||||
}
|
||||
.orEmpty().toList()
|
||||
return Product(
|
||||
repositoryId,
|
||||
packageName,
|
||||
name,
|
||||
summary,
|
||||
description,
|
||||
whatsNew,
|
||||
icon,
|
||||
metadataIcon,
|
||||
Author(authorName, authorEmail, authorWeb),
|
||||
source,
|
||||
changelog,
|
||||
web,
|
||||
tracker,
|
||||
added,
|
||||
updated,
|
||||
suggestedVersionCode,
|
||||
categories,
|
||||
antiFeatures,
|
||||
licenses,
|
||||
donates.sortedWith(IndexHandler.DonateComparator),
|
||||
screenshots,
|
||||
emptyList()
|
||||
repositoryId = repositoryId,
|
||||
packageName = packageName,
|
||||
name = name,
|
||||
summary = summary,
|
||||
description = description,
|
||||
added = added,
|
||||
updated = updated,
|
||||
icon = icon,
|
||||
metadataIcon = metadataIcon,
|
||||
releases = emptyList(),
|
||||
categories = categories,
|
||||
antiFeatures = antiFeatures,
|
||||
licenses = licenses,
|
||||
donates = donates.sortedWith(IndexHandler.DonateComparator),
|
||||
screenshots = screenshots,
|
||||
suggestedVersionCode = suggestedVersionCode,
|
||||
author = Author(authorName, authorEmail, authorWeb),
|
||||
source = source,
|
||||
web = web,
|
||||
tracker = tracker,
|
||||
changelog = changelog,
|
||||
whatsNew = whatsNew
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -4,9 +4,9 @@ import android.content.Context
|
||||
import android.net.Uri
|
||||
import com.looker.droidify.content.Cache
|
||||
import com.looker.droidify.database.DatabaseX
|
||||
import com.looker.droidify.database.entity.Product
|
||||
import com.looker.droidify.database.entity.Release
|
||||
import com.looker.droidify.database.entity.Repository
|
||||
import com.looker.droidify.entity.Product
|
||||
import com.looker.droidify.network.Downloader
|
||||
import com.looker.droidify.utility.ProgressInputStream
|
||||
import com.looker.droidify.utility.RxUtils
|
||||
@ -469,6 +469,9 @@ object RepositoryUpdater {
|
||||
.copy(incompatibilities = incompatibilities, selected = firstSelected
|
||||
?.let { it.first.versionCode == release.versionCode && it.second == incompatibilities } == true)
|
||||
}
|
||||
return product.copy(releases = releases)
|
||||
return product.apply {
|
||||
this.releases = releases
|
||||
refreshVariables()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user