fix: fix the fix for MangaUpdates (#327)
Further filtering prevents the bad records from cancelling the whole operation
This commit is contained in:
parent
dd994dcfab
commit
04538c52f2
2 changed files with 13 additions and 8 deletions
|
@ -993,12 +993,7 @@ fun countDown(media: Media, view: ViewGroup) {
|
|||
fun sinceWhen(media: Media, view: ViewGroup) {
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
MangaUpdates().search(media.name ?: media.nameRomaji, media.startDate)?.let {
|
||||
val latestChapter = it.metadata.series.latestChapter ?: it.record.chapter?.let { chapter ->
|
||||
if (chapter.contains("-"))
|
||||
chapter.split("-")[1].trim()
|
||||
else
|
||||
chapter
|
||||
}?.toIntOrNull() ?: return@launch
|
||||
val latestChapter = MangaUpdates.getLatestChapter(it)
|
||||
val timeSince = (System.currentTimeMillis() -
|
||||
(it.metadata.series.lastUpdated!!.timestamp * 1000)) / 1000
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue