chore (MangaRestorer): move sorting Merged source to sort function
This commit is contained in:
parent
ad8a9edc12
commit
f2bf5d8664
2 changed files with 5 additions and 3 deletions
|
|
@ -18,7 +18,6 @@ import eu.kanade.tachiyomi.data.backup.restore.restorers.MangaRestorer
|
|||
import eu.kanade.tachiyomi.data.backup.restore.restorers.PreferenceRestorer
|
||||
import eu.kanade.tachiyomi.data.backup.restore.restorers.SavedSearchRestorer
|
||||
import eu.kanade.tachiyomi.util.system.createFileInCacheDir
|
||||
import exh.source.MERGED_SOURCE_ID
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
import kotlinx.coroutines.ensureActive
|
||||
|
|
@ -175,7 +174,6 @@ class BackupRestorer(
|
|||
backupCategories: List<BackupCategory>,
|
||||
) = launch {
|
||||
mangaRestorer.sortByNew(backupMangas)
|
||||
/* SY --> */.sortedBy { it.source == MERGED_SOURCE_ID } /* SY <-- */
|
||||
.forEach {
|
||||
ensureActive()
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import eu.kanade.tachiyomi.data.backup.models.BackupManga
|
|||
import eu.kanade.tachiyomi.data.backup.models.BackupMergedMangaReference
|
||||
import eu.kanade.tachiyomi.data.backup.models.BackupTracking
|
||||
import exh.EXHMigrations
|
||||
import exh.source.MERGED_SOURCE_ID
|
||||
import tachiyomi.data.DatabaseHandler
|
||||
import tachiyomi.data.UpdateStrategyColumnAdapter
|
||||
import tachiyomi.data.manga.MangaMapper
|
||||
|
|
@ -64,7 +65,10 @@ class MangaRestorer(
|
|||
|
||||
return backupMangas
|
||||
.sortedWith(
|
||||
compareBy<BackupManga> { it.url in urlsBySource[it.source].orEmpty() }
|
||||
// KMK -->
|
||||
compareBy<BackupManga> { it.source == MERGED_SOURCE_ID }
|
||||
// KMK <--
|
||||
.then(compareBy { it.url in urlsBySource[it.source].orEmpty() })
|
||||
.then(compareByDescending { it.lastModifiedAt }),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue