fix chapter source order not working correctly and allow refresh to update source order

Co-Authored-By: Carlos <2092019+CarlosEsco@users.noreply.github.com>
This commit is contained in:
Jays2Kings 2021-07-07 18:13:04 -04:00
parent 5f7069437e
commit 02fa9841e7

View File

@ -74,6 +74,7 @@ fun syncChaptersWithSource(
dbChapter.name = sourceChapter.name dbChapter.name = sourceChapter.name
dbChapter.date_upload = sourceChapter.date_upload dbChapter.date_upload = sourceChapter.date_upload
dbChapter.chapter_number = sourceChapter.chapter_number dbChapter.chapter_number = sourceChapter.chapter_number
dbChapter.source_order = sourceChapter.source_order
toChange.add(dbChapter) toChange.add(dbChapter)
} }
} }
@ -162,8 +163,9 @@ fun syncChaptersWithSource(
} }
// checks if the chapter in db needs updated // checks if the chapter in db needs updated
private fun shouldUpdateDbChapter(dbChapter: Chapter, sourceChapter: SChapter): Boolean { private fun shouldUpdateDbChapter(dbChapter: Chapter, sourceChapter: Chapter): Boolean {
return dbChapter.scanlator != sourceChapter.scanlator || dbChapter.name != sourceChapter.name || return dbChapter.scanlator != sourceChapter.scanlator || dbChapter.name != sourceChapter.name ||
dbChapter.date_upload != sourceChapter.date_upload || dbChapter.date_upload != sourceChapter.date_upload ||
dbChapter.chapter_number != sourceChapter.chapter_number dbChapter.chapter_number != sourceChapter.chapter_number ||
dbChapter.source_order != sourceChapter.source_order
} }