Allow download ahead even if entry isn't favorited

This commit is contained in:
arkon 2023-07-08 17:46:48 -04:00
parent a585d46e7a
commit f8cf3db4a4
2 changed files with 4 additions and 4 deletions

View file

@ -204,6 +204,7 @@ class ReaderViewModel(
}
private val incognitoMode = preferences.incognitoMode().get()
private val downloadAheadAmount = downloadPreferences.autoDownloadWhileReading().get()
init {
// To save state
@ -444,9 +445,8 @@ class ReaderViewModel(
}
private fun downloadNextChapters() {
if (downloadAheadAmount == 0) return
val manga = manga ?: return
val amount = downloadPreferences.autoDownloadWhileReading().get()
if (amount == 0 || !manga.favorite) return
// Only download ahead if current + next chapter is already downloaded too to avoid jank
if (getCurrentChapter()?.pageLoader?.isLocal == true) return
@ -466,7 +466,7 @@ class ReaderViewModel(
} else {
this
}
}.take(amount)
}.take(downloadAheadAmount)
downloadManager.downloadChapters(
manga,

View file

@ -470,7 +470,7 @@
<item quantity="one">Next unread chapter</item>
<item quantity="other">Next %d unread chapters</item>
</plurals>
<string name="download_ahead_info">Only works on entries in library and if the current chapter plus the next one are already downloaded</string>
<string name="download_ahead_info">Only works if the current chapter + the next one are already downloaded.</string>
<string name="save_chapter_as_cbz">Save as CBZ archive</string>
<string name="split_tall_images">Split tall images</string>
<string name="split_tall_images_summary">Improves reader performance</string>