Skip to content

Commit

Permalink
Simplify toSubjectCollectionInfo (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 committed Nov 8, 2024
1 parent a20131e commit 6653a99
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import kotlinx.coroutines.sync.Semaphore
import kotlinx.coroutines.sync.withPermit
import kotlinx.coroutines.withContext
import me.him188.ani.app.data.models.episode.EpisodeCollectionInfo
import me.him188.ani.app.data.models.episode.isKnownCompleted
import me.him188.ani.app.data.models.subject.SelfRatingInfo
import me.him188.ani.app.data.models.subject.SubjectAiringInfo
import me.him188.ani.app.data.models.subject.SubjectCollectionCounts
Expand Down Expand Up @@ -399,19 +398,7 @@ private fun SubjectCollectionEntity.toSubjectCollectionInfo(
episodes.map { it.episodeInfo },
airDate,
),
progressInfo = SubjectProgressInfo.compute(
subjectStarted = currentDate > subjectInfo.airDate,
episodes = episodes.map {
SubjectProgressInfo.Episode(
it.episodeId,
it.collectionType,
it.episodeInfo.sort,
it.episodeInfo.airDate,
it.episodeInfo.isKnownCompleted,
)
},
subjectAirDate = subjectInfo.airDate,
),
progressInfo = SubjectProgressInfo.compute(subjectInfo, episodes, currentDate),
cachedStaffUpdated = cachedStaffUpdated,
cachedCharactersUpdated = cachedCharactersUpdated,
)
Expand Down

0 comments on commit 6653a99

Please sign in to comment.