Skip to content

Limit download progress percentage to range 0-100#425

Merged
johan12345 merged 1 commit into
ev-map:masterfrom
robho:download_progress_max_100
Jun 1, 2026
Merged

Limit download progress percentage to range 0-100#425
johan12345 merged 1 commit into
ev-map:masterfrom
robho:download_progress_max_100

Conversation

@robho
Copy link
Copy Markdown
Contributor

@robho robho commented May 31, 2026

For nobil the percentage reaches 101. I haven't figured out why nobil's data is out of sync.

When querying nobil for the total number of chargers we get:

Norway: 4957
Sweden: 9108
------------
       14065

.. but the data dump we download has:

Norway: 5168
Sweden: 9059
------------
       14227

Could be fixed in the nobil data source instead if that's more appropriate..
Eg:

--- a/app/src/main/java/net/vonforst/evmap/api/nobil/NobilApi.kt
+++ b/app/src/main/java/net/vonforst/evmap/api/nobil/NobilApi.kt
@@ -348,7 +348,7 @@ class NobilFullDownloadResult(private val data: NobilDynamicResponseData,
             }
         }
     override val progress: Float
-        get() = downloadProgress
+        get() = min(1.0, downloadProgress)
     override val referenceData: NobilReferenceData
         get() = refData ?: throw UnsupportedOperationException("referenceData is only available once download is complete")
 }

For nobil the percentage reaches 101. I haven't figured out why nobil's data
is out of sync.

When querying nobil for the total number of chargers we get:
Norway: 4957
Sweden: 9108
------------
       14065

.. but the data dump we download has:
Norway: 5168
Sweden: 9059
------------
       14227
@johan12345 johan12345 merged commit 0cbb2d8 into ev-map:master Jun 1, 2026
8 checks passed
@robho robho deleted the download_progress_max_100 branch June 1, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants