1
0
Fork 0

support date filtering for all google reader api item ID calls

This commit is contained in:
Dave Marquard 2022-10-08 15:23:22 -07:00 committed by Frédéric Guillot
parent d947b0194b
commit 7a961babd4

View file

@ -1123,6 +1123,13 @@ func (h *handler) handleReadingListStream(w http.ResponseWriter, r *http.Request
builder.WithLimit(rm.Count)
builder.WithOrder(model.DefaultSortingOrder)
builder.WithDirection(rm.SortDirection)
if rm.StartTime > 0 {
builder.AfterDate(time.Unix(rm.StartTime, 0))
}
if rm.StopTime > 0 {
builder.BeforeDate(time.Unix(rm.StopTime, 0))
}
rawEntryIDs, err := builder.GetEntryIDs()
if err != nil {
logger.Error("[GoogleReader][/stream/items/ids#reading-list] [ClientIP=%s] %v", clientIP, err)
@ -1145,6 +1152,13 @@ func (h *handler) handleStarredStream(w http.ResponseWriter, r *http.Request, rm
builder.WithLimit(rm.Count)
builder.WithOrder(model.DefaultSortingOrder)
builder.WithDirection(rm.SortDirection)
if rm.StartTime > 0 {
builder.AfterDate(time.Unix(rm.StartTime, 0))
}
if rm.StopTime > 0 {
builder.BeforeDate(time.Unix(rm.StopTime, 0))
}
rawEntryIDs, err := builder.GetEntryIDs()
if err != nil {
logger.Error("[GoogleReader][/stream/items/ids#starred] [ClientIP=%s] %v", clientIP, err)