|
|
|
@ -61,6 +61,7 @@ class RepoUpdater(repoData2: RepoData) {
|
|
|
|
|
val moduleListCacheDao = db.moduleListCacheDao()
|
|
|
|
|
// now we have the cache, we need to check if it's up to date
|
|
|
|
|
val results = moduleListCacheDao.getByRepoId(repoData.preferenceId!!)
|
|
|
|
|
if (results.isNotEmpty()) {
|
|
|
|
|
toUpdate = emptyList()
|
|
|
|
|
toApply = HashSet()
|
|
|
|
|
for (moduleListCache in results) {
|
|
|
|
@ -95,13 +96,17 @@ class RepoUpdater(repoData2: RepoData) {
|
|
|
|
|
}
|
|
|
|
|
// log first 100 chars of indexRaw
|
|
|
|
|
indexRaw = jsonObject.toString().toByteArray()
|
|
|
|
|
Timber.d("Index raw: %s", String(indexRaw!!, StandardCharsets.UTF_8).subSequence(0, 100))
|
|
|
|
|
Timber.d(
|
|
|
|
|
"Index raw: %s",
|
|
|
|
|
String(indexRaw!!, StandardCharsets.UTF_8).subSequence(0, 100)
|
|
|
|
|
)
|
|
|
|
|
// Since we reuse instances this should work
|
|
|
|
|
toApply = HashSet(repoData.moduleHashMap.values)
|
|
|
|
|
(toApply as HashSet<RepoModule>).removeAll(toUpdate!!.toSet())
|
|
|
|
|
// Return repo to update
|
|
|
|
|
return toUpdate!!.size
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return try {
|
|
|
|
|
if (!repoData.prepare()) {
|
|
|
|
|
indexRaw = null
|
|
|
|
|