mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-10 11:08:56 +01:00
Download ahead (#7226)
This commit is contained in:
@@ -157,6 +157,20 @@ class DownloadManager(
|
||||
downloader.queueChapters(manga, chapters, autoStart)
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells the downloader to enqueue the given list of downloads at the start of the queue.
|
||||
*
|
||||
* @param downloads the list of downloads to enqueue.
|
||||
*/
|
||||
fun addDownloadsToStartOfQueue(downloads: List<Download>) {
|
||||
val wasEmpty = queue.isEmpty()
|
||||
queue.toMutableList().apply {
|
||||
addAll(0, downloads)
|
||||
reorderQueue(this)
|
||||
}
|
||||
if (wasEmpty) startDownloads()
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the page list of a downloaded chapter.
|
||||
*
|
||||
|
||||
@@ -275,11 +275,13 @@ class PreferencesHelper(val context: Context) {
|
||||
|
||||
fun pinnedSources() = flowPrefs.getStringSet("pinned_catalogues", emptySet())
|
||||
|
||||
fun downloadNewChapter() = flowPrefs.getBoolean("download_new", false)
|
||||
fun downloadNewChapters() = flowPrefs.getBoolean("download_new", false)
|
||||
|
||||
fun downloadNewChapterCategories() = flowPrefs.getStringSet("download_new_categories", emptySet())
|
||||
fun downloadNewChapterCategoriesExclude() = flowPrefs.getStringSet("download_new_categories_exclude", emptySet())
|
||||
|
||||
fun autoDownloadWhileReading() = flowPrefs.getInt("auto_download_while_reading", 0)
|
||||
|
||||
fun defaultCategory() = prefs.getInt(Keys.defaultCategory, -1)
|
||||
|
||||
fun categorizedDisplaySettings() = flowPrefs.getBoolean("categorized_display", false)
|
||||
|
||||
Reference in New Issue
Block a user