mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-24 03:42:15 +00:00
Add: Categories field to Product table
This commit is contained in:
parent
2c1a542b0f
commit
d31dd0c675
@ -23,6 +23,7 @@ const val ROW_COMPATIBLE = "compatible"
|
|||||||
const val ROW_ICON = "icon"
|
const val ROW_ICON = "icon"
|
||||||
const val ROW_METADATA_ICON = "metadataIcon"
|
const val ROW_METADATA_ICON = "metadataIcon"
|
||||||
const val ROW_RELEASES = "releases"
|
const val ROW_RELEASES = "releases"
|
||||||
|
const val ROW_CATEGORIES = "categories"
|
||||||
const val ROW_VERSION = "version"
|
const val ROW_VERSION = "version"
|
||||||
const val ROW_SIGNATURE = "signature"
|
const val ROW_SIGNATURE = "signature"
|
||||||
const val ROW_ID = "_id"
|
const val ROW_ID = "_id"
|
||||||
|
@ -128,7 +128,7 @@ interface ProductDao : BaseDao<Product> {
|
|||||||
product.${ROW_COMPATIBLE} != 0 AND product.${ROW_VERSION_CODE} >
|
product.${ROW_COMPATIBLE} != 0 AND product.${ROW_VERSION_CODE} >
|
||||||
COALESCE(installed.${ROW_VERSION_CODE}, 0xffffffff) AND $signatureMatches)
|
COALESCE(installed.${ROW_VERSION_CODE}, 0xffffffff) AND $signatureMatches)
|
||||||
AS ${ROW_CAN_UPDATE}, product.${ROW_COMPATIBLE},
|
AS ${ROW_CAN_UPDATE}, product.${ROW_COMPATIBLE},
|
||||||
product.${ROW_ICON}, product.${ROW_METADATA_ICON}, product.${ROW_RELEASES},"""
|
product.${ROW_ICON}, product.${ROW_METADATA_ICON}, product.${ROW_RELEASES}, product.${ROW_CATEGORIES},"""
|
||||||
|
|
||||||
// Calculate the matching score with the search query
|
// Calculate the matching score with the search query
|
||||||
if (searchQuery.isNotEmpty()) {
|
if (searchQuery.isNotEmpty()) {
|
||||||
@ -294,6 +294,7 @@ interface ProductTempDao : BaseDao<ProductTemp> {
|
|||||||
icon = it.icon
|
icon = it.icon
|
||||||
metadataIcon = it.metadataIcon
|
metadataIcon = it.metadataIcon
|
||||||
releases = it.releases
|
releases = it.releases
|
||||||
|
categories = it.categories
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
it.categories.forEach { category ->
|
it.categories.forEach { category ->
|
||||||
|
@ -21,7 +21,7 @@ import kotlinx.coroutines.launch
|
|||||||
CategoryTemp::class,
|
CategoryTemp::class,
|
||||||
Installed::class,
|
Installed::class,
|
||||||
Lock::class
|
Lock::class
|
||||||
], version = 2
|
], version = 3
|
||||||
)
|
)
|
||||||
@TypeConverters(Converters::class)
|
@TypeConverters(Converters::class)
|
||||||
abstract class DatabaseX : RoomDatabase() {
|
abstract class DatabaseX : RoomDatabase() {
|
||||||
|
@ -20,6 +20,7 @@ open class Product {
|
|||||||
var icon = ""
|
var icon = ""
|
||||||
var metadataIcon = ""
|
var metadataIcon = ""
|
||||||
var releases: List<Release> = emptyList()
|
var releases: List<Release> = emptyList()
|
||||||
|
var categories: List<String> = emptyList()
|
||||||
|
|
||||||
// TODO Remove in next iteration
|
// TODO Remove in next iteration
|
||||||
@ColumnInfo(typeAffinity = ColumnInfo.BLOB)
|
@ColumnInfo(typeAffinity = ColumnInfo.BLOB)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user