Fix/chapter list fetch updating and inserting chapters into database (#749)

* Keep initial fetch date of existing chapters on a list fetch

The fetch at date should not get updated for existing chapters.
Updating this field makes it impossible to detect which chapters were actually newly fetched.
To get the last fetched timestamp of the chapters, the "chaptersLastFetchedAt" field of the manga should be used

got changed in 6d33d72663

* Get real chapter url safely

In case this causes an exception, it should not cause the whole list fetch to fail

was removed in 6d33d72663
This commit is contained in:
schroda
2023-11-02 01:24:34 +01:00
committed by GitHub
parent 673053d291
commit 4324373e61
@@ -150,7 +150,9 @@ object Chapter {
index + 1,
now,
mangaId,
(source as? HttpSource)?.getChapterUrl(fetchedChapter),
runCatching {
(source as? HttpSource)?.getChapterUrl(fetchedChapter)
}.getOrNull(),
)
if (chapterEntry == null) {
@@ -184,7 +186,6 @@ object Chapter {
this[ChapterTable.chapter_number] = it.chapterNumber
this[ChapterTable.scanlator] = it.scanlator
this[ChapterTable.sourceOrder] = it.index
this[ChapterTable.fetchedAt] = it.fetchedAt
this[ChapterTable.realUrl] = it.realUrl
}
execute(this@transaction)