diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OpenHumansUploader.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OpenHumansUploader.kt index ee930d78f5..72981db972 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OpenHumansUploader.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/openhumans/OpenHumansUploader.kt @@ -356,7 +356,7 @@ class OpenHumansUploader @Inject constructor( if (currentProgress % 1000L == 0L) showOngoingNotification(maxProgress, currentProgress) } copyDisposable = Completable.fromCallable { MainApp.getDbHelper().clearOpenHumansQueue() } - .andThen(Single.defer { Single.just(MainApp.getDbHelper().countOfAllRows) }) + .andThen(Single.defer { Single.just(MainApp.getDbHelper().countOfAllRows + treatmentsPlugin.service.count()) }) .doOnSuccess { maxProgress = it } .flatMapObservable { Observable.defer { Observable.fromIterable(treatmentsPlugin.service.treatmentData) } } .map { enqueueTreatment(it); increaseCounter() } @@ -648,4 +648,4 @@ class OpenHumansUploader @Inject constructor( private fun onSharedPreferenceChanged(event: EventPreferenceChange) { if (event.changedKey == "key_oh_charging_only" && isSetup) scheduleWorker(true) } -} \ No newline at end of file +}