mirror of
https://github.com/Ashinch/ReadYou.git
synced 2025-01-31 19:45:18 +01:00
Signed-off-by: Mark Bestavros <markbest@bu.edu>
This commit is contained in:
parent
b6ff8dfafa
commit
470dff5eec
@ -19,7 +19,7 @@ enum class MarkAsReadConditions {
|
||||
;
|
||||
|
||||
fun toDate(): Date? = when (this) {
|
||||
All -> null
|
||||
All -> Date()
|
||||
else -> Calendar.getInstance().apply {
|
||||
time = Date()
|
||||
add(Calendar.DAY_OF_MONTH, when (this@MarkAsReadConditions) {
|
||||
|
@ -199,12 +199,13 @@ class FeverRssRepository @Inject constructor(
|
||||
) {
|
||||
super.markAsRead(groupId, feedId, articleId, before, isUnread)
|
||||
val feverAPI = getFeverAPI()
|
||||
var beforeUnixTimestamp = (before?.time ?: Date(Long.MAX_VALUE).time) / 1000
|
||||
when {
|
||||
groupId != null -> {
|
||||
feverAPI.markGroup(
|
||||
status = if (isUnread) FeverDTO.StatusEnum.Unread else FeverDTO.StatusEnum.Read,
|
||||
id = groupId.dollarLast().toLong(),
|
||||
before = before?.time ?: Date(Long.MAX_VALUE).time
|
||||
before = beforeUnixTimestamp
|
||||
)
|
||||
}
|
||||
|
||||
@ -212,7 +213,7 @@ class FeverRssRepository @Inject constructor(
|
||||
feverAPI.markFeed(
|
||||
status = if (isUnread) FeverDTO.StatusEnum.Unread else FeverDTO.StatusEnum.Read,
|
||||
id = feedId.dollarLast().toLong(),
|
||||
before = before?.time ?: Date(Long.MAX_VALUE).time
|
||||
before = beforeUnixTimestamp
|
||||
)
|
||||
}
|
||||
|
||||
@ -228,7 +229,7 @@ class FeverRssRepository @Inject constructor(
|
||||
feverAPI.markFeed(
|
||||
status = if (isUnread) FeverDTO.StatusEnum.Unread else FeverDTO.StatusEnum.Read,
|
||||
id = it.id.dollarLast().toLong(),
|
||||
before = before?.time ?: Date(Long.MAX_VALUE).time
|
||||
before = beforeUnixTimestamp
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user