mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
fix(fever): correct sorting direction when using max_id argument
This commit is contained in:
parent
e98e16e45a
commit
f3a5a3ee14
2 changed files with 4 additions and 4 deletions
|
@ -247,7 +247,6 @@ func (h *handler) handleItems(w http.ResponseWriter, r *http.Request) {
|
||||||
builder := h.store.NewEntryQueryBuilder(userID)
|
builder := h.store.NewEntryQueryBuilder(userID)
|
||||||
builder.WithoutStatus(model.EntryStatusRemoved)
|
builder.WithoutStatus(model.EntryStatusRemoved)
|
||||||
builder.WithLimit(50)
|
builder.WithLimit(50)
|
||||||
builder.WithSorting("id", model.DefaultSortingDirection)
|
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case request.HasQueryParam(r, "since_id"):
|
case request.HasQueryParam(r, "since_id"):
|
||||||
|
@ -258,6 +257,7 @@ func (h *handler) handleItems(w http.ResponseWriter, r *http.Request) {
|
||||||
slog.Int64("since_id", sinceID),
|
slog.Int64("since_id", sinceID),
|
||||||
)
|
)
|
||||||
builder.AfterEntryID(sinceID)
|
builder.AfterEntryID(sinceID)
|
||||||
|
builder.WithSorting("id", "ASC")
|
||||||
}
|
}
|
||||||
case request.HasQueryParam(r, "max_id"):
|
case request.HasQueryParam(r, "max_id"):
|
||||||
maxID := request.QueryInt64Param(r, "max_id", 0)
|
maxID := request.QueryInt64Param(r, "max_id", 0)
|
||||||
|
|
|
@ -402,13 +402,13 @@ func (e *EntryQueryBuilder) GetEntryIDs() ([]int64, error) {
|
||||||
query := `
|
query := `
|
||||||
SELECT
|
SELECT
|
||||||
e.id
|
e.id
|
||||||
FROM
|
FROM
|
||||||
entries e
|
entries e
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
feeds f
|
feeds f
|
||||||
ON
|
ON
|
||||||
f.id=e.feed_id
|
f.id=e.feed_id
|
||||||
WHERE
|
WHERE
|
||||||
%s %s
|
%s %s
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue