Skip to content
This repository was archived by the owner on May 23, 2025. It is now read-only.

Commit a36f0ae

Browse files
committed
feat: add support for config of downloadUrl
1 parent 79fb0db commit a36f0ae

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/src/main/java/cn/umafan/lib/android/util/DownloadUtil.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ object DownloadUtil {
6262
}
6363

6464
private fun download(dbVersion: Int, activity: MyBaseActivity, url: String?) {
65-
val baseUrl = url ?: BASE_URL
6665
if (isDownloading) return
6766
val context = MyApplication.context
6867
val fetchConfiguration: FetchConfiguration = FetchConfiguration.Builder(context)
@@ -71,7 +70,7 @@ object DownloadUtil {
7170
fetch = Fetch.Impl.getInstance(fetchConfiguration)
7271

7372
val name = "${dbVersion}.zip"
74-
val request = Request(baseUrl + name, getLocalFilePath(name))
73+
val request = Request(url ?: (BASE_URL + name), getLocalFilePath(name))
7574
request.priority = Priority.HIGH
7675
request.networkType = NetworkType.ALL
7776

0 commit comments

Comments
 (0)