diff --git a/app/src/main/java/soko/ekibun/bangumi/api/bangumi/bean/Episode.kt b/app/src/main/java/soko/ekibun/bangumi/api/bangumi/bean/Episode.kt index 868243c..0360bf0 100644 --- a/app/src/main/java/soko/ekibun/bangumi/api/bangumi/bean/Episode.kt +++ b/app/src/main/java/soko/ekibun/bangumi/api/bangumi/bean/Episode.kt @@ -11,8 +11,6 @@ import soko.ekibun.bangumi.R import soko.ekibun.bangumi.api.ApiHelper import soko.ekibun.bangumi.api.bangumi.Bangumi import java.text.DecimalFormat -import java.text.SimpleDateFormat -import java.util.* /** * 剧集类 @@ -49,12 +47,7 @@ data class Episode( category = category ?: ep.category } - val isAir - get() = status == STATUS_AIR || progress == PROGRESS_WATCH || (category?.startsWith("Disc") ?: false) || try { - SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).parse(airdate ?: "")!!.time < Date().time - } catch (e: Exception) { - false - } + val isAir get() = status == STATUS_AIR || progress == PROGRESS_WATCH || (category?.startsWith("Disc") ?: false) /** * 第*话 diff --git a/app/src/main/java/soko/ekibun/bangumi/ui/main/MainPresenter.kt b/app/src/main/java/soko/ekibun/bangumi/ui/main/MainPresenter.kt index 6cd79b7..f024ab4 100644 --- a/app/src/main/java/soko/ekibun/bangumi/ui/main/MainPresenter.kt +++ b/app/src/main/java/soko/ekibun/bangumi/ui/main/MainPresenter.kt @@ -134,6 +134,11 @@ class MainPresenter(private val context: MainActivity) { context.runOnUiThread { context.notifyMenu?.badge = notify?.let { it.first + it.second } ?: 0 } }) collectionCall?.enqueue(ApiHelper.buildCallback({ + it.forEach { subject -> + calendar.find { cal -> cal.id == subject.id }?.eps?.forEach { calEp -> + subject.eps?.find { ep -> ep.id == calEp.id }?.merge(calEp) + } + } collectionList = it callback(it) }, {