mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Set manga last update field based on chapter fetch time (closes #2217)
Based on 3c81f60041 (diff-7e5179d048c3dfaf75b444b7277fc840)
This commit is contained in:
parent
98f86a44ef
commit
ee8a53188c
1 changed files with 3 additions and 2 deletions
|
@ -128,8 +128,9 @@ fun syncChaptersWithSource(db: DatabaseHelper,
|
||||||
// Fix order in source.
|
// Fix order in source.
|
||||||
db.fixChaptersSourceOrder(sourceChapters).executeAsBlocking()
|
db.fixChaptersSourceOrder(sourceChapters).executeAsBlocking()
|
||||||
|
|
||||||
// Set this manga as updated since chapters were changed
|
// Set manga's last update time to latest chapter's fetch time if possible
|
||||||
manga.last_update = Date().time
|
val newestChapter = db.getChapters(manga).executeAsBlocking().maxBy { it.date_fetch }
|
||||||
|
manga.last_update = newestChapter?.date_fetch ?: manga.last_update
|
||||||
db.updateLastUpdated(manga).executeAsBlocking()
|
db.updateLastUpdated(manga).executeAsBlocking()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue