mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-21 20:27:06 +03:00
feat(downloader): Restrict parallel downloads to unmetered sources (#1137)
Co-authored-by: jmir1 <jhmiramon@gmail.com>
This commit is contained in:
parent
6554900024
commit
861a5ad913
3 changed files with 9 additions and 3 deletions
|
@ -69,8 +69,9 @@ object SettingsDownloadScreen : SearchableSettings {
|
|||
Preference.PreferenceItem.ListPreference(
|
||||
pref = downloadPreferences.numberOfDownloads(),
|
||||
title = stringResource(R.string.pref_download_slots),
|
||||
entries = listOf(1, 2, 3).associateWith { it.toString() },
|
||||
entries = (1..5).associateWith { it.toString() },
|
||||
),
|
||||
Preference.PreferenceItem.InfoPreference(stringResource(R.string.download_slots_info)),
|
||||
getDeleteChaptersGroup(
|
||||
downloadPreferences = downloadPreferences,
|
||||
categories = allCategories,
|
||||
|
|
|
@ -216,10 +216,14 @@ class AnimeDownloader(
|
|||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
},
|
||||
downloadPreferences.numberOfDownloads().get(),
|
||||
if (sourceManager.get(bySource.key.id) is UnmeteredSource) {
|
||||
downloadPreferences.numberOfDownloads().get()
|
||||
} else {
|
||||
1
|
||||
},
|
||||
)
|
||||
},
|
||||
3,
|
||||
5,
|
||||
)
|
||||
.subscribe(
|
||||
{ completedDownload ->
|
||||
|
|
|
@ -339,4 +339,5 @@
|
|||
<string name="resmush">resmush.it</string>
|
||||
<string name="bandwidth_data_saver_server">Bandwidth Hero Proxy Server</string>
|
||||
<string name="data_saver_server_summary">Put Bandwidth Hero Proxy server url here</string>
|
||||
<string name="download_slots_info">Will only download concurrently from self-hosted or unmetered sources</string>
|
||||
</resources>
|
Loading…
Reference in a new issue