/..
This commit is contained in:
parent
3784f973ca
commit
10ac465aba
@ -489,7 +489,7 @@ internal class LauncherHome : Fragment() {
|
|||||||
WorkersDb.getRealm().writeBlocking {
|
WorkersDb.getRealm().writeBlocking {
|
||||||
delete(
|
delete(
|
||||||
query<RssData>()
|
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("category != $0 AND category != $1 ", RssDataType.GURU.name, RssDataType.MOST.name)
|
||||||
.query("vote != $0", true).find()
|
.query("vote != $0", true).find()
|
||||||
)
|
)
|
||||||
|
|||||||
@ -15,6 +15,14 @@ fun before30Min(date: Date): Long {
|
|||||||
return cal.timeInMillis
|
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 {
|
fun beforeDay(date: Date?, day: Int): Long {
|
||||||
val cal: Calendar = Calendar.getInstance()
|
val cal: Calendar = Calendar.getInstance()
|
||||||
cal.setTime(date)
|
cal.setTime(date)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user