File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
app/src/main/java/eu/kanade/tachiyomi/data Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,7 @@ class MangaRestorer(
202202 bookmark = chapter.bookmark || dbChapter.bookmark,
203203 read = chapter.read,
204204 lastPageRead = chapter.lastPageRead,
205+ sourceOrder = chapter.sourceOrder,
205206 )
206207 } else {
207208 chapter.copyFrom(dbChapter).let {
@@ -252,7 +253,7 @@ class MangaRestorer(
252253 bookmark = chapter.bookmark,
253254 lastPageRead = chapter.lastPageRead,
254255 chapterNumber = null ,
255- sourceOrder = null ,
256+ sourceOrder = if (isSync) chapter.sourceOrder else null ,
256257 dateFetch = null ,
257258 dateUpload = null ,
258259 chapterId = chapter.id,
Original file line number Diff line number Diff line change @@ -233,7 +233,12 @@ abstract class SyncService(
233233 localChapter != null && remoteChapter != null -> {
234234 // Use version number to decide which chapter to keep
235235 val chosenChapter = if (localChapter.version >= remoteChapter.version) {
236- localChapter
236+ // If there mare more chapter on remote, local sourceOrder will need to be updated to maintain correct source order.
237+ if (localChapters.size < remoteChapters.size) {
238+ localChapter.copy(sourceOrder = remoteChapter.sourceOrder)
239+ } else {
240+ localChapter
241+ }
237242 } else {
238243 remoteChapter
239244 }
@@ -500,6 +505,7 @@ abstract class SyncService(
500505 logcat(LogPriority .DEBUG , logTag) { " Using remote saved search: ${remoteSearch.name} ." }
501506 remoteSearch
502507 }
508+
503509 else -> {
504510 logcat(LogPriority .DEBUG , logTag) {
505511 " No saved search found for composite key: $compositeKey . Skipping."
You can’t perform that action at this time.
0 commit comments