Temporarily revert concurrent manga updates
(cherry picked from commit e208fa402077165e69c738c95398c5216544ad3e) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
This commit is contained in:
parent
1c0f08fc5b
commit
38d329a601
@ -264,13 +264,9 @@ class LibraryUpdateService(
|
|||||||
|
|
||||||
// Emit each manga and update it sequentially.
|
// Emit each manga and update it sequentially.
|
||||||
return Observable.from(mangaToUpdate)
|
return Observable.from(mangaToUpdate)
|
||||||
// Update the chapters of the manga concurrently from 5 different sources
|
|
||||||
.groupBy { it.source }
|
|
||||||
.flatMap(
|
|
||||||
{ bySource ->
|
|
||||||
bySource
|
|
||||||
// Notify manga that will update.
|
// Notify manga that will update.
|
||||||
.doOnNext { notifier.showProgressNotification(it, count.andIncrement, mangaToUpdate.size) }
|
.doOnNext { notifier.showProgressNotification(it, count.andIncrement, mangaToUpdate.size) }
|
||||||
|
// Update the chapters of the manga.
|
||||||
.concatMap { manga ->
|
.concatMap { manga ->
|
||||||
if (manga.source in LIBRARY_UPDATE_EXCLUDED_SOURCES) {
|
if (manga.source in LIBRARY_UPDATE_EXCLUDED_SOURCES) {
|
||||||
// Ignore EXH manga, updating chapters for every manga will get you banned
|
// Ignore EXH manga, updating chapters for every manga will get you banned
|
||||||
@ -294,21 +290,15 @@ class LibraryUpdateService(
|
|||||||
hasDownloads = true
|
hasDownloads = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Convert to the manga that contains new chapters.
|
// Convert to the manga that contains new chapters.
|
||||||
.map {
|
.map {
|
||||||
Pair(
|
Pair(
|
||||||
manga,
|
manga,
|
||||||
(
|
(it.first.sortedByDescending { ch -> ch.source_order }.toTypedArray())
|
||||||
it.first.sortedByDescending { ch -> ch.source_order }
|
|
||||||
.toTypedArray()
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
5
|
|
||||||
)
|
|
||||||
// Add manga with new chapters to the list.
|
// Add manga with new chapters to the list.
|
||||||
.doOnNext { manga ->
|
.doOnNext { manga ->
|
||||||
// Add to the list
|
// Add to the list
|
||||||
@ -332,7 +322,8 @@ class LibraryUpdateService(
|
|||||||
.map { manga -> manga.first }
|
.map { manga -> manga.first }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun downloadChapters(manga: Manga, chapters: List<Chapter>) {
|
|
||||||
|
private fun downloadChapters(manga: Manga, chapters: List<Chapter>) {
|
||||||
// we need to get the chapters from the db so we have chapter ids
|
// we need to get the chapters from the db so we have chapter ids
|
||||||
val mangaChapters = db.getChapters(manga).executeAsBlocking()
|
val mangaChapters = db.getChapters(manga).executeAsBlocking()
|
||||||
val dbChapters = chapters.map {
|
val dbChapters = chapters.map {
|
||||||
|
@ -19,7 +19,7 @@ import eu.kanade.tachiyomi.util.preference.preferenceCategory
|
|||||||
import eu.kanade.tachiyomi.util.preference.switchPreference
|
import eu.kanade.tachiyomi.util.preference.switchPreference
|
||||||
import eu.kanade.tachiyomi.util.preference.titleRes
|
import eu.kanade.tachiyomi.util.preference.titleRes
|
||||||
import eu.kanade.tachiyomi.util.system.LocaleHelper
|
import eu.kanade.tachiyomi.util.system.LocaleHelper
|
||||||
import java.util.Calendar
|
import java.util.Date
|
||||||
import kotlinx.coroutines.flow.launchIn
|
import kotlinx.coroutines.flow.launchIn
|
||||||
|
|
||||||
class SettingsGeneralController : SettingsController() {
|
class SettingsGeneralController : SettingsController() {
|
||||||
@ -94,9 +94,9 @@ class SettingsGeneralController : SettingsController() {
|
|||||||
titleRes = R.string.pref_date_format
|
titleRes = R.string.pref_date_format
|
||||||
entryValues = arrayOf("", "MM/dd/yy", "dd/MM/yy", "yyyy-MM-dd")
|
entryValues = arrayOf("", "MM/dd/yy", "dd/MM/yy", "yyyy-MM-dd")
|
||||||
|
|
||||||
val currentDate = Calendar.getInstance().time
|
val now = Date().time
|
||||||
entries = entryValues.map { value ->
|
entries = entryValues.map { value ->
|
||||||
val formattedDate = preferences.dateFormat(value.toString()).format(currentDate)
|
val formattedDate = preferences.dateFormat(value.toString()).format(now)
|
||||||
if (value == "") {
|
if (value == "") {
|
||||||
"${context.getString(R.string.system_default)} ($formattedDate)"
|
"${context.getString(R.string.system_default)} ($formattedDate)"
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user