Skip to content

Commit

Permalink
调整完结后隐藏单集资源的阈值为 12 个月 close #1018
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 committed Sep 25, 2024
1 parent 02d7e85 commit ed1c4ea
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* Copyright (C) 2024 OpenAni and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license, which can be found at the following link.
*
* https://github.com/open-ani/ani/blob/main/LICENSE
*/

package me.him188.ani.app.data.models.episode

import androidx.compose.ui.util.fastAll
Expand All @@ -17,6 +26,6 @@ object EpisodeCollections {
.filter { it.isValid }
.maxOrNull()

return maxAirDate != null && now - maxAirDate >= 14.days
return maxAirDate != null && now - maxAirDate >= 365.days
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* Copyright (C) 2024 OpenAni and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license, which can be found at the following link.
*
* https://github.com/open-ani/ani/blob/main/LICENSE
*/

package me.him188.ani.app.data.models

import me.him188.ani.app.data.models.episode.EpisodeCollections
Expand All @@ -11,14 +20,14 @@ class EpisodeCollectionsTest {

@Test
@Disabled
fun `subject completed after 14 days`() {
fun `subject completed after 365 days`() {
assertTrue {
EpisodeCollections.isSubjectCompleted(
sequenceOf(
PackedDate(2023, 10, 4),
PackedDate(2023, 10, 11),
),
now = PackedDate(2023, 10, 11 + 14),
now = PackedDate(2024, 10, 11),
)
}
}
Expand All @@ -31,7 +40,7 @@ class EpisodeCollectionsTest {
PackedDate(2023, 10, 4),
PackedDate(2023, 10, 11),
),
now = PackedDate(2023, 10, 11 + 13),
now = PackedDate(2024, 10, 9),
)
}
}
Expand Down

0 comments on commit ed1c4ea

Please sign in to comment.