This commit is contained in:
lunaticbum 2024-12-06 18:28:08 +09:00
parent 3784f973ca
commit 10ac465aba
2 changed files with 9 additions and 1 deletions

View File

@ -489,7 +489,7 @@ internal class LauncherHome : Fragment() {
WorkersDb.getRealm().writeBlocking {
delete(
query<RssData>()
.query("pubDate < $0", beforeDay(Date(), 3))
.query("pubDate < $0", beforeDay())
.query("category != $0 AND category != $1 ", RssDataType.GURU.name, RssDataType.MOST.name)
.query("vote != $0", true).find()
)

View File

@ -15,6 +15,14 @@ fun before30Min(date: Date): Long {
return cal.timeInMillis
}
fun beforeDay(): Long {
val cal: Calendar = Calendar.getInstance()
cal.setTime(Date())
cal.add(Calendar.DAY_OF_YEAR, -1)
cal.add(Calendar.HOUR_OF_DAY, -6)
return cal.timeInMillis
}
fun beforeDay(date: Date?, day: Int): Long {
val cal: Calendar = Calendar.getInstance()
cal.setTime(date)