|
|
|
|
@ -41,6 +41,9 @@ class Patcher { |
|
|
|
|
Preferences.executeOnce(Preferences.Keys.PATCH_NEGATIVE_LIMITS, context) { |
|
|
|
|
patchNegativeLimits() |
|
|
|
|
} |
|
|
|
|
Preferences.executeOnce(Preferences.Keys.CLEAN_BLINDS_FILTERS, context) { |
|
|
|
|
cleanBlindsFilters() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Preferences.executeOnce(Preferences.Keys.ADD_NEW_TRANSACTION_TYPES, context) { |
|
|
|
|
|
|
|
|
|
@ -164,6 +167,17 @@ class Patcher { |
|
|
|
|
realm.close() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun cleanBlindsFilters() { |
|
|
|
|
val realm = Realm.getDefaultInstance() |
|
|
|
|
realm.executeTransaction { |
|
|
|
|
val blindFilterConditions = realm.where(FilterCondition::class.java).equalTo("filterName", "AnyBlind").findAll() |
|
|
|
|
val filterIds = blindFilterConditions.mapNotNull { it.filters?.firstOrNull() }.map { it.id } |
|
|
|
|
val filters = realm.where(Filter::class.java).`in`("id", filterIds.toTypedArray()).findAll() |
|
|
|
|
filters.deleteAllFromRealm() |
|
|
|
|
} |
|
|
|
|
realm.close() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
02/09/19: A bug with the session set management made them kept instead of deleted, |
|
|
|
|
thus making duration calculation wrong |
|
|
|
|
|